提交 96e71c76 编写于 作者: [ [zmy2771345724]

Merge branch 'master' of https://gitee.com/LinkWeChat/link-wechat

......@@ -32,7 +32,7 @@ Node >= 10
##### 后端运行
- 导入LinkWeChat到Eclipse,菜单 File -> Import,然后选择 Maven -> Existing Maven Projects,点击 Next> 按钮,选择工作目录,然后点击 Finish 按钮,即可成功导入Eclipse会自动加载Maven依赖包,初次加载会比较慢(根据自身网络情况而定)
- 导入IDEA中
- 创建数据库LW-vue并导入数据脚本
- 打开运行com.linkwechat. LinkWeChatApplication.java
......
......@@ -53,7 +53,8 @@ public class WeDepartmentController extends BaseController
@ApiOperation("添加部门")
public AjaxResult add(@Validated @RequestBody WeDepartment weDepartment)
{
return toAjax(weDepartmentService.insertWeDepartment(weDepartment));
weDepartmentService.insertWeDepartment(weDepartment);
return AjaxResult.success();
}
/**
......@@ -65,7 +66,8 @@ public class WeDepartmentController extends BaseController
@ApiOperation("更新部门")
public AjaxResult edit(@RequestBody WeDepartment weDepartment)
{
return toAjax(weDepartmentService.updateWeDepartment(weDepartment));
weDepartmentService.updateWeDepartment(weDepartment);
return AjaxResult.success();
}
//
// /**
......
......@@ -45,6 +45,7 @@ public class WeUserController extends BaseController {
public TableDataInfo list(WeUser weUser)
{
startPage();
List<WeUser> list = weUserService.selectWeUserList(weUser);
return getDataTable(list);
}
......
......@@ -5,12 +5,32 @@ const service = config.services.wecom + '/user'
* 获取离职未分配员工列表
* @param {*} params
* {
* pageNum:
pageNum:
pageSize:
userName:离职人员名称
beginTime:}
beginTime:
endTime:
userName:
}
*/
export function getList(params) {
return request({
url: service + '/leaveUserAllocateList',
params
})
}
/**
* 获取离职已分配员工列表
* @param {*} params
* {
pageNum:
pageSize:
beginTime:
endTime:
userName:
}
*/
export function getListNo(params) {
return request({
url: service + '/leaveUserNoAllocateList',
params
......
......@@ -35,3 +35,13 @@ export function getMembers(params) {
params
})
}
/**
* 客户群同步接口
*/
export function sync() {
return request({
url: service + '/chat/synchWeGroup',
})
}
<style lang="scss" scoped>
.el-card-inner {
h4 {
margin: 12px 0 24px;
}
p {
font-size: 14px;
color: #606266 !important;
margin-bottom: 13px;
padding: 0;
margin: 1em 0;
}
.upload-desc {
align-items: start;
}
}
</style>
<template>
<div>
<el-card shadow="never">
<div class="el-card-inner">
<h4>创建自建应用并设置应用主页</h4>
<p>
请在企业微信官方后台“应用管理-自建应用”(
<el-link
type="primary"
href="https://work.weixin.qq.com/wework_admin/loginpage_wx?redirect_uri=https://work.weixin.qq.com/wework_admin/frame#apps"
target="_blank"
>官方后台链接</el-link>)创建自建应用用于聊天工具栏。
</p>
<p>
然后在“客户联系-配置-聊天工具栏管理”(
<el-link
type="primary"
href="https://work.weixin.qq.com/wework_admin/loginpage_wx?redirect_uri=https://work.weixin.qq.com/wework_admin/frame#apps"
target="_blank"
>官方后台链接</el-link>)的配置应用页面,选择该应用并将以下网址链接复制并设置为自定义应用主页。
<el-button type="text">查看图示讲解</el-button>
</p>
<span>访问地址</span>
<el-input v-model="jio" disabled style="width: 350px; margin: 0px 15px;" placeholder></el-input>
<el-button type="primary">复制链接地址</el-button>
<p>请将该链接设置为聊天工具栏应用主页,用于聊天工具栏页面访问。否则无法正常使用聊天工具栏</p>
</div>
</el-card>
<el-card shadow="never">
<div class="el-card-inner">
<h4>设置应用可信域名</h4>
<p>
请在企业微信官方后台“应用管理-自建应用”(
<el-link
type="primary"
href="https://work.weixin.qq.com/wework_admin/loginpage_wx?redirect_uri=https://work.weixin.qq.com/wework_admin/frame#apps"
target="_blank"
>官方后台链接</el-link>),打开用于聊天工具栏的应用设置页,将qw.wshoto.com设置为可信域名,并下载校验文件保存到电脑本地后,在此处上传。
<button
type="button"
class="el-button el-button--text el-button--medium"
>
<!---->
<!---->
<span>查看图示讲解</span>
</button>
</p>
<p class="upload-desc flex">
<span style="float: left;">上传校验文件:</span>
<el-upload
action
on-preview
on-remove
before-remove
multiple
limit="3"
on-exceed
:file-list="[{name: 'name', url: 'url'}]"
>
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">请上传txt格式的校验文件,用于完成域名归属验证。否则无法正常使用聊天工具栏</div>
</el-upload>
</p>
</div>
</el-card>
<div class="ac">
<el-checkbox v-model="d" >已配置好聊天工具栏应用主页和应用可信域名</el-checkbox>
<div><el-button type="primary">完成配置,去抓取素材</el-button></div>
</div>
</div>
</template>
<script>
export default {
components: {},
props: {},
data() {
return {};
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {},
};
</script>
<style lang="scss" scoped>
.section-box {
margin-top: 32px;
&:first-of-type {
margin-top: 0;
}
.section-step {
height: 22px;
line-height: 22px;
padding: 0 7px;
text-align: center;
color: #fff;
background-color: #faad14;
display: inline-block;
font-size: 14px;
margin-bottom: 12px;
}
.message {
font-size: 14px;
color: #606266;
line-height: 22px;
font-weight: 400;
}
}
</style>
<template>
<div class="main-page">
<el-card shadow="never">
<div class="section-box">
<div class="section-step">什么是聊天工具栏?</div>
<div class="message">
企业微信3.0.16版本更新原聊天侧边栏升级为聊天工具栏。升级后:1.可以配置小程序了;2.入口更浅,交互体验更好;3.可配置第三方应用的页面了。
<br />企业可以把CRM页面、商品页面、知识库等挂接到聊天工具栏,方便员工和在客户聊天时,快速查看和编辑客户信息、快速给客户发东西、快速查找回答等。
</div>
</div>
<div class="section-box">
<div class="section-step">员工视角:聊天工具栏</div>
<div class="message">员工在与客户单聊或者外部群聊的时候,点击右上角的图标,对话框上方即可出现工具栏。</div>
<img
src="https://wscos-1253767630.cos.ap-nanjing.myqcloud.com/wework/assets/siber/1.png"
class="image"
style="width: 818px; height: 495px;"
/>
</div>
<div class="section-box">
<div class="section-step">员工视角:电脑端外部群及单聊聊天侧边栏界面</div>
<div class="message">员工在与客户单聊或者外部群聊的时候,点击右上角的图标,对话框上方即可出现工具栏。</div>
<img
src="https://wscos-1253767630.cos.ap-nanjing.myqcloud.com/wework/assets/siber/2.png"
class="image"
style="width: 818px; height: 494px;"
/>
<img
src="https://wscos-1253767630.cos.ap-nanjing.myqcloud.com/wework/assets/siber/3.png"
class="image"
style="width: 818px; height: 483px;"
/>
<div
class="message"
style="margin-top: 32px;"
>聊天侧边栏的素材支持文本、网页、图文视频及文件,售前售后在客户服务过程中选择需要的素材直接即可发送。</div>
<img
src="https://wscos-1253767630.cos.ap-nanjing.myqcloud.com/wework/assets/siber/4.png"
class="image"
style="width: 984px; height: 572px;"
/>
</div>
<div class="section-box">
<div class="section-step">如何配置聊天工具栏?</div>
<img
src="https://wscos-1253767630.cos.ap-nanjing.myqcloud.com/wework/assets/siber/5.png"
class="image"
style="width: 1154px; height: 639px;"
/>
<img
src="https://wscos-1253767630.cos.ap-nanjing.myqcloud.com/wework/assets/siber/6.png"
class="image"
style="width: 550px; height: 634px;"
/>
</div>
<div class="section-box">
<div class="section-step">聊天工具栏的内容是如何维护的?</div>
<img
src="https://wscos-1253767630.cos.ap-nanjing.myqcloud.com/wework/assets/siber/7.png"
class="image"
style="width: 1176px; height: 629px;"
/>
<img
src="https://wscos-1253767630.cos.ap-nanjing.myqcloud.com/wework/assets/siber/8.png"
class="image"
style="width: 555px; height: 634px;"
/>
<img
src="https://wscos-1253767630.cos.ap-nanjing.myqcloud.com/wework/assets/siber/9.png"
class="image"
style="width: 797px; height: 387px;"
/>
<img
src="https://wscos-1253767630.cos.ap-nanjing.myqcloud.com/wework/assets/siber/10.png"
class="image"
style="width: 797px; height: 387px;"
/>
</div>
</el-card>
</div>
</template>
<script>
export default {
components: {},
props: {},
data() {
return {};
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {},
};
</script>
<style lang="scss" scoped>
.chat-preview {
border-radius: 4px;
position: relative;
margin-left: 40px;
display: inline-block;
width: 150px;
min-height: 263px;
background-repeat: no-repeat;
background-size: cover;
top: 15px;
.logo {
width: 40px;
height: 40px;
position: absolute;
top: 18px;
left: 50%;
transform: translateX(-50%);
border-radius: 50%;
}
.company-name {
font-size: 12px;
position: absolute;
top: 70px;
text-align: center;
color: #ffe7be;
width: 100%;
}
}
</style>
<template>
<div>
<div>
配置聊天工具栏,方便成员在外部会话中查看和使用,提高服务效率。
<el-button type="text" @click="$router.push('/appTool/explain')">图文详解</el-button>
<el-button type="text" @click="$router.push('/appTool/config')">查看已配置信息</el-button>
</div>
<div>
<span>抓取快捷回复素材</span> 素材抓取后,即可在聊天工具栏使用
</div>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="素材类型" align="center" prop="operId" />
<el-table-column label="聊天工具栏名称" align="center" prop="title" />
<el-table-column label="已抓取素材数量" align="center" prop="businessType" :formatter="typeFormat" />
<el-table-column label="是否启用" align="center" prop="operTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.operTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" prop="operId">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
>抓取素材</el-button>
</template>
</el-table-column>
</el-table>
<el-card shadow="never" header="红包工具栏">
<!-- <div slot="header"></div> -->
<el-row :gutter="10">
<el-col :span="10">
<div>
<div>
发红包权限人
<el-button type="text">修改</el-button>
</div>
<el-tag type="info" effect="plain">
<i class="el-icon-user-solid"></i> 深肤色
</el-tag>
<el-tag type="info" effect="plain">
<i class="el-icon-user-solid"></i>深肤色
</el-tag>
<el-tag type="info" effect="plain">
<i class="el-icon-user-solid"></i>深肤色
</el-tag>
</div>
<el-form ref="form" :model="form" label-width="100px">
<el-form-item label="企业logo">
<el-upload action :show-file-list="false" :on-success="d" :before-upload="d">
<img v-if="imageUrl" :src="imageUrl" />
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<div>上传企业logo,建议112*112</div>
</el-form-item>
<el-form-item label="企业名称">
<el-input v-model="model"></el-input>
</el-form-item>
<el-form-item label="红包应用ID">
<el-input v-model="model"></el-input>
</el-form-item>
</el-form>
</el-col>
<el-col :span="10">
<div
class="chat-preview"
style="background-image: url(&quot;https://wscos-1253767630.cos.ap-nanjing.myqcloud.com/wework/assets/red-packet.png&quot;);"
>
<div class="el-image logo" style>
<div class="el-image__error">加载失败</div>
<!---->
</div>
<el-image class="logo" :src="url" :fit="fit"></el-image>
<div class="company-name">脑白金</div>
</div>
</el-col>
</el-row>
</el-card>
<el-dialog
title="抓取文本类型素材库"
:visible.sync="dialogVisible"
:before-close="dialogBeforeClose"
>
<el-row :gutter="10">
<el-col :span="6">
<el-tree :data="d" :props="d" @node-click="d"></el-tree>
</el-col>
<el-col :span="18">
<div class="fxbw">
素材库更新本分类素材后,自动同步到聊天工具栏
<div class="filter-right">
<i class="el-icon-arrow-left"></i> 1/1
<i class="el-icon-arrow-right"></i>
</div>
</div>
<el-table :data="data" style="width: 100%">
<el-table-column type="selection" width="55" align="center" />
<el-table-column prop="prop" label="文本内容" width="width"></el-table-column>
<el-table-column prop="prop" label="时间" width="width"></el-table-column>
</el-table>
</el-col>
</el-row>
<div slot="footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
components: {},
props: {},
data() {
return {
dialogVisible: true,
};
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {},
};
</script>
<style lang="scss" scoped>
.preview {
width: 260px;
height: 500px;
background: #eee;
border-radius: 8px;
padding: 10px;
}
</style>
<template>
<div>
<el-card shadow="never">
<el-row type="flex" justify="center" :gutter="50">
<el-col :span="10">
<el-form ref="form" :model="form" label-width="80px">
<el-form-item label="公司名称">
<el-input v-model="model"></el-input>
</el-form-item>
<el-form-item label="背景图片">
<el-upload action :show-file-list="false" :on-success="d" :before-upload="d">
<img v-if="imageUrl" :src="imageUrl" />
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" size="small">提交</el-button>
</el-form-item>
</el-form>
</el-col>
<el-col :span="10">
<div class="preview">
<div class="top">房管局会</div>
</div>
</el-col>
</el-row>
</el-card>
</div>
</template>
<script>
export default {
components: {},
props: {},
data() {
return {};
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {},
};
</script>
<style lang="scss" scoped>
.section-box {
margin-top: 32px;
&:first-of-type {
margin-top: 0;
}
.section-step {
height: 22px;
line-height: 22px;
padding: 0 7px;
text-align: center;
color: #fff;
background-color: #faad14;
display: inline-block;
font-size: 14px;
margin-bottom: 12px;
}
.message {
font-size: 14px;
color: #606266;
line-height: 22px;
font-weight: 400;
}
}
</style>
<template>
<div>
<div class="el-card__body">
<div class="section-box">
<div class="section-step">第一步</div>
<div class="message">管理员登录企业微信管理后台,在我的企业——通讯录管理——成员资料显示——对外资料显示,点击修改;</div>
<img
src="https://wscos-1253767630.cos.ap-nanjing.myqcloud.com/wework/assets/moment/1.png"
class="image"
style="width: 882px; height: 277px;"
/>
<div class="message">点击添加自定义信息,选择网页,名称填写朋友圈,确定保存后,员工对外资料页就会出现朋友圈这一项信息。</div>
<img
src="https://wscos-1253767630.cos.ap-nanjing.myqcloud.com/wework/assets/moment/2.png"
class="image"
style="width: 750px; height: 817px;"
/>
</div>
<div class="section-box">
<div class="section-step">第二步</div>
<div
class="message"
>完成修改后,返回企业微信手机端,打开对外信息显示,填写朋友圈网页信息;该栏需要输入网页名称,建议填写“查看朋友圈”;</div>
<img
src="https://wscos-1253767630.cos.ap-nanjing.myqcloud.com/wework/assets/moment/3.png"
class="image"
style="width: 439px; height: 526px;"
/>
</div>
<div class="section-box">
<div class="section-step">第三步</div>
<div class="message">
获取朋友圈地址。后台管理员可一键发送、导出、复制员工的朋友圈地址。
<br />员工将朋友圈链接粘贴到对外信息显示的朋友圈列表内,这样客户打开员工的对外资料,就能看到员工发布的朋友圈。
</div>
<img
src="https://wscos-1253767630.cos.ap-nanjing.myqcloud.com/wework/assets/moment/4.png"
class="image"
style="width: 561px; height: 577px;"
/>
</div>
</div>
</div>
</template>
<script>
export default {
components: {},
props: {},
data() {
return {};
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {},
};
</script>
<style lang="scss" scoped>
</style>
<template>
<div>
<el-tabs type="border-card" v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="朋友圈动态" name="1">
<div>
* 该朋友圈为展示在企业成员对外资料显示中的企业朋友圈,
<!-- <el-button type="primary">查看功能介绍</el-button> -->
<el-link type="primary" href="/appTool/friendIntroduce">查看功能介绍</el-link>
</div>
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="100px">
<el-form-item label="关键词" prop="title">
<el-input
v-model="queryParams.title"
placeholder="请输入"
clearable
style="width: 240px;"
size="small"
/>
</el-form-item>
<el-form-item label="发布时间">
<el-date-picker
v-model="dateRange"
size="small"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label>
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
</el-form-item>
</el-form>
<div class="ar">
<el-button type="primary">发布动态</el-button>
</div>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="所选成员" align="center" prop="operId" />
<el-table-column label="发布内容" align="center" prop="title" />
<el-table-column label="创建人" align="center" prop="businessType" />
<el-table-column label="发布时间" align="center" prop="operTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.operTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
v-hasPermi="['monitor:operlog:query']"
>下载</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
v-hasPermi="['monitor:operlog:query']"
>复制链接</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
v-hasPermi="['monitor:operlog:query']"
>查看详情</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
v-hasPermi="['monitor:operlog:query']"
>编辑</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
v-hasPermi="['monitor:operlog:query']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改参数配置对话框 -->
<el-dialog title="编辑图片" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="图片名称">
<el-input v-model="sd" placeholder></el-input>
</el-form-item>
<el-form-item label="图片文案">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
</el-form-item>
<el-form-item label="图片">
<el-upload action :show-file-list="false" :on-success="d" :before-upload="d">
<img v-if="imageUrl" :src="imageUrl" />
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<div>支持JPG,PNG格式,图片大小不超过2M,建议上传宽高1:1的图片</div>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</el-tab-pane>
<el-tab-pane label="设置" name="2">
<div class="ar">
<el-input
placeholder="请输入内容"
prefix-icon="el-icon-search"
style="width: 240px;"
v-model="input2"
></el-input>
<el-button @click="$router.push('/appTool/friendBackground')">设置默认背景图片</el-button>
<el-button type="primary">一键设置朋友圈地址</el-button>
</div>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column label="员工" align="center" prop="operId" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
v-hasPermi="['monitor:operlog:query']"
>编辑头像背景</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row,scope.index)"
v-hasPermi="['monitor:operlog:query']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
export default {
components: {},
props: {},
data() {
return {
queryParams: {},
form: {},
activeName: "1",
};
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {},
};
</script>
<style lang="scss" scoped>
.content-wrap {
height: 500px;
align-items: stretch;
justify-content: space-between;
padding-right: 6%;
.el-tabs,
.preview {
width: 60%;
background: #eee;
border-radius: 8px;
padding: 10px;
}
.preview {
width: 260px;
}
}
</style>
<template>
<div class="app-container">
<el-card shadow="never" :body-style="{padding: '40px 20px 20px'}">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="选择员工" prop="postCode">
<el-button type="primary" size="mini">选择</el-button>
</el-form-item>
<el-form-item label="朋友圈内容">
<div class="flex content-wrap">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-button class="fr" type="primary" size="mini">新建素材</el-button>
<el-tab-pane name="first">
<span slot="label">
<i class="el-icon-date"></i> 文本
</span>
<el-upload action="#" list-type="picture-card" :auto-upload="false">
<i slot="default" class="el-icon-plus"></i>
<div slot="file" slot-scope="{file}">
<img class="el-upload-list__item-thumbnail" :src="file.url" alt />
<span class="el-upload-list__item-actions">
<span
class="el-upload-list__item-preview"
@click="handlePictureCardPreview(file)"
>
<i class="el-icon-zoom-in"></i>
</span>
<span
v-if="!disabled"
class="el-upload-list__item-delete"
@click="handleDownload(file)"
>
<i class="el-icon-download"></i>
</span>
<span
v-if="!disabled"
class="el-upload-list__item-delete"
@click="handleRemove(file)"
>
<i class="el-icon-delete"></i>
</span>
</span>
</div>
</el-upload>
</el-tab-pane>
<el-tab-pane label="角色管理" name="third">
<span slot="label">
<i class="el-icon-date"></i> 图片
</span>
角色管理
</el-tab-pane>
<el-tab-pane label="定时任务补偿" name="fourth">
<span slot="label">
<i class="el-icon-date"></i> 视频
</span>
定时任务补偿
</el-tab-pane>
</el-tabs>
<div class="preview">
<div class="top">房管局会</div>
</div>
</div>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" size="small">提交</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</template>
<script>
export default {
components: {},
props: {},
data() {
return {
// 表单参数
form: {},
statusOptions: [
{ label: "发送给客户", value: "" },
{ label: "发送给客户群", value: "" },
],
activeName: "second",
};
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {
handleClick(tab, event) {
console.log(tab, event);
},
},
};
</script>
......@@ -11,7 +11,7 @@ export default {
pageNum: 1,
pageSize: 10,
isActivate: "",
department: "1",
department: "",
},
dateRange: [],
treeData: [],
......@@ -31,7 +31,7 @@ export default {
total: 0,
defaultProps: {
label: "name",
childr启用en: "children",
children: "children",
},
form: {},
dialogVisible: false,
......
......@@ -172,7 +172,7 @@ export default {
});
api.sync().then(() => {
loading.close();
this.msgSuccess("操作成功");
this.msgSuccess("后台开始同步数据,请稍后关注进度");
});
},
selectedUser(list) {
......
......@@ -43,7 +43,7 @@ export default {
</div>
<div class="info">
出生日期{{customer.birthday || '--'}}
<div class="ml20" style="position: absolute;">
<div class="bfc-d ml20">
<el-date-picker
v-if="datePickerVisible"
v-model="customer.birthday"
......@@ -87,7 +87,7 @@ export default {
</el-row>
<el-row :gutter="10">
<el-col :span="10">所在部门</el-col>
<el-col :span="12">{{"--"}}</el-col>
<el-col :span="12">{{customer.weFlowerCustomerRels[0].department}}</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="10">添加时间</el-col>
......
......@@ -39,7 +39,7 @@ export default {
page && (this.query.pageNum = page);
this.loading = true;
api
.getList(this.query)
.getListNo(this.query)
.then(({ rows, total }) => {
this.list = rows;
this.total = +total;
......@@ -111,6 +111,7 @@ export default {
v-hasPermi="['customerManage:dimission:filter']"
type="primary"
size="mini"
@click="getList(1)"
>已分配的离职员工</el-button>
<el-button
v-hasPermi="['customerManage:dimission:allocate']"
......
......@@ -65,6 +65,18 @@ export default {
this.dateRange = [];
this.$refs["queryForm"].resetFields();
},
sync() {
const loading = this.$loading({
lock: true,
text: "Loading",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)",
});
api.sync().then((r) => {
loading.close();
this.msgSuccess("后台开始同步数据,请稍后关注进度");
});
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
......@@ -166,11 +178,12 @@ export default {
<div class="mid-action">
<div class="total">
己选
<span class="num">{{total}}</span> 个客户群
<!-- 己选
<span class="num">{{total}}</span> 个客户群-->
<span>
最近更新:2020-08-25 06:35:00,同步
<span class="num">{{total}}</span> 条信息 ,共
<!-- 最近更新:2020-08-25 06:35:00,同步
<span class="num">{{total}}</span> 条信息 ,-->
<span class="num">{{total}}</span> 个客户群
</span>
</div>
......@@ -180,6 +193,7 @@ export default {
type="primary"
size="mini"
icon="el-icon-refresh"
@click="sync"
>同步客户群</el-button>
</div>
</div>
......@@ -188,7 +202,7 @@ export default {
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="群名" align="center" prop="groupName" />
<el-table-column label="群人数" align="center" prop="memberNum" />
<el-table-column label="群主" align="center" prop="groupLeader" />
<el-table-column label="群主" align="center" prop="groupLeaderName" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180"></el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
......
......@@ -34,6 +34,11 @@ export default {
groupId: undefined,
memberName: undefined,
},
joinScene: {
1: "由成员邀请入群(直接邀请入群)",
2: "由成员邀请入群(通过邀请链接入群)",
3: "通过扫描群二维码入群",
},
};
},
created() {
......@@ -130,14 +135,14 @@ export default {
<div style="margin-bottom: 20px;">{{group.groupName}}</div>
<div
class="info"
>群主:{{group.groupLeader}} | 创建时间:{{group.createTime}} | 群公告:{{group.notice || '未设置'}}</div>
>群主:{{group.groupLeaderName}} | 创建时间:{{group.createTime}} | 群公告:{{group.notice || '未设置'}}</div>
</div>
</div>
<el-input placeholder="请输入群成员" v-model="query.memberName" class>
<el-button slot="append" @click="getList(1)">查询</el-button>
</el-input>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column label="群成员" align="center" prop="operId">
<template slot-scope="scope">
{{ scope.row.memberName }}
......@@ -147,12 +152,12 @@ export default {
<!-- <i :class="['el-icon-s-custom', ({1: 'man', 2: 'woman'})[scope.row.gender]]"></i> -->
</template>
</el-table-column>
<el-table-column label="进群时间" align="center" prop="joinTime" width="180">
<el-table-column label="进群时间" align="center" prop="joinTime" width="180"></el-table-column>
<el-table-column label="进群方式" align="center" prop="joinScene">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.joinTime) }}</span>
<span>{{ joinScene[scope.row.joinScene] }}</span>
</template>
</el-table-column>
<el-table-column label="进群方式" align="center" prop="joinType" />
</el-table>
<pagination
......@@ -160,7 +165,7 @@ export default {
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getList"
@pagination="getList()"
/>
</div>
</template>
......
......@@ -9,6 +9,7 @@ export default {
dialogVisible: false,
dialogVisible1: false,
form: { id: "", welcomeMsgTplType: "", welcomeMsg: "" },
imageUrl: "",
};
},
watch: {},
......@@ -25,6 +26,23 @@ export default {
insertName() {
this.form.welcomeMsg += "#客户昵称#";
},
uploadSuccess(res, file) {
debugger;
this.imageUrl = URL.createObjectURL(file.raw);
},
beforeUpload(file) {
debugger;
const isJPG = file.type === "image/jpeg";
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isJPG) {
this.$message.error("上传头像图片只能是 JPG 格式!");
}
if (!isLt2M) {
this.$message.error("上传头像图片大小不能超过 2MB!");
}
return isJPG && isLt2M;
},
},
};
</script>
......@@ -54,17 +72,18 @@ export default {
>插入客户昵称</el-button>
</div>
<el-divider></el-divider>
<img v-if="imageUrl" :src="imageUrl" />
<el-popover placement="top-start" trigger="hover">
<div class="flex">
<el-upload
class="mr10"
action
:show-file-list="false"
:on-success="on-success"
:before-upload="before-upload"
:on-success="uploadSuccess"
:before-upload="beforeUpload"
>
<img v-if="imageUrl" :src="imageUrl" />
<el-button v-else>
<el-button>
<i class="el-icon-picture-outline"></i>
<p>图片</p>
</el-button>
......@@ -79,7 +98,7 @@ export default {
<p>小程序</p>
</el-button>-->
</div>
<el-button slot="reference" icon="el-icon-plus" size="mini" @click="resetQuery">添加图片/网页</el-button>
<el-button slot="reference" icon="el-icon-plus" size="mini">添加图片/网页</el-button>
</el-popover>
</el-card>
</el-form-item>
......@@ -99,12 +118,7 @@ export default {
</div>
</div>
<el-dialog
title="添加网页消息"
:visible.sync="dialogVisible"
width="width"
:before-close="dialogBeforeClose"
>
<el-dialog title="添加网页消息" :visible.sync="dialogVisible" width="width">
<el-form :model="form" inline>
<el-form-item label="添加网页消息" label-width="200">
<el-input style="width: 400px;" v-model="j" placeholder="以http或https开头"></el-input>
......@@ -116,11 +130,10 @@ export default {
</div>
</el-dialog>
<el-dialog
<!-- <el-dialog
title="添加小程序消息"
:visible.sync="dialogVisible1"
width="width"
:before-close="dialogBeforeClose"
>
<div class="flex filter-wrap">
<el-select v-model="model" placeholder="请选择分组">
......@@ -152,7 +165,7 @@ export default {
<el-button @click="dialogVisible1 = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible1 = false">确 定</el-button>
</div>
</el-dialog>
</el-dialog>-->
</div>
</template>
......
<style lang="scss" scoped>
.content-wrap {
height: 500px;
align-items: stretch;
justify-content: space-between;
padding-right: 6%;
.el-tabs,
.preview {
width: 60%;
background: #eee;
border-radius: 8px;
padding: 10px;
}
.preview {
width: 260px;
}
}
</style>
<template>
<div class="app-container">
<el-card shadow="never" :body-style="{padding: '40px 20px 20px'}">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="群发类型" prop="postName">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in statusOptions"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="发送范围" prop="postCode">
<el-button type="primary" size="mini">选择发送客户</el-button>
</el-form-item>
<el-form-item label="发送时间" prop="postSort">
<el-date-picker
v-model="form.status"
size="small"
style="width: 240px"
value-format="yyyy-MM-dd"
type="datetime"
placeholder="开始日期"
></el-date-picker>
<span>设置时间定时发送,不设置立即发送</span>
</el-form-item>
<el-form-item label=" ">
<div class="flex content-wrap">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-button class="fr" type="primary" size="mini">新建素材</el-button>
<el-tab-pane name="first">
<span slot="label">
<i class="el-icon-date"></i> 文本
</span>
<el-upload action="#" list-type="picture-card" :auto-upload="false">
<i slot="default" class="el-icon-plus"></i>
<div slot="file" slot-scope="{file}">
<img class="el-upload-list__item-thumbnail" :src="file.url" alt />
<span class="el-upload-list__item-actions">
<span
class="el-upload-list__item-preview"
@click="handlePictureCardPreview(file)"
>
<i class="el-icon-zoom-in"></i>
</span>
<span
v-if="!disabled"
class="el-upload-list__item-delete"
@click="handleDownload(file)"
>
<i class="el-icon-download"></i>
</span>
<span
v-if="!disabled"
class="el-upload-list__item-delete"
@click="handleRemove(file)"
>
<i class="el-icon-delete"></i>
</span>
</span>
</div>
</el-upload>
</el-tab-pane>
<el-tab-pane label="配置管理" name="second">
<span slot="label">
<i class="el-icon-date"></i> 网页
</span>
配置管理
</el-tab-pane>
<el-tab-pane label="角色管理" name="third">
<span slot="label">
<i class="el-icon-date"></i> 图片
</span>
角色管理
</el-tab-pane>
<el-tab-pane label="定时任务补偿" name="fourth">
<span slot="label">
<i class="el-icon-date"></i> 海报
</span>
定时任务补偿
</el-tab-pane>
<el-tab-pane label="定时任务补偿" name="fourth">
<span slot="label">
<i class="el-icon-date"></i> 小程序
</span>
定时任务补偿
</el-tab-pane>
</el-tabs>
<div class="preview">
<div class="top">房管局会</div>
</div>
</div>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" size="mini" icon="el-icon-search">通知成员发送</el-button>
<span>通知成员,向选中的客户发送以上企业消息</span>
<i class="el-icon-edit"></i>
</el-form-item>
</el-form>
</el-card>
</div>
</template>
<script>
export default {
components: {},
props: {},
data() {
return {
// 表单参数
form: {},
statusOptions: [
{ label: "发送给客户", value: "" },
{ label: "发送给客户群", value: "" },
],
activeName: "second",
};
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {
handleClick(tab, event) {
console.log(tab, event);
},
},
};
</script>
<style lang="scss" scoped>
.mid-action {
display: flex;
justify-content: space-between;
margin: 10px 0;
align-items: center;
.total {
background-color: rgba(65, 133, 244, 0.1);
border: 1px solid rgba(65, 133, 244, 0.2);
border-radius: 3px;
font-size: 14px;
min-height: 32px;
line-height: 32px;
padding: 0 12px;
color: #606266;
}
.num {
color: #00f;
}
}
</style>
<template>
<div class="app-container">
<el-card shadow="never" :body-style="{padding: '20px 0 0'}">
<el-form
:model="queryParams"
ref="queryForm"
:inline="true"
v-show="showSearch"
label-width="100px"
>
<el-form-item label="创建人" prop="title">
<el-input
v-model="queryParams.title"
placeholder="请输入"
clearable
style="width: 240px;"
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="内容消息" prop="operName">
<el-input
v-model="queryParams.operName"
placeholder="请输入"
clearable
style="width: 240px;"
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="群发类型">
<el-select v-model="form.region" placeholder="请选择" size="small" style="width: 240px;">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select>
</el-form-item>
<el-form-item label="创建日期">
<el-date-picker
v-model="dateRange"
size="small"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label=" ">
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="消息内容" align="center" prop="operId" />
<el-table-column label="群发类型" align="center" prop="title" />
<el-table-column label="创建人" align="center" prop="businessType" :formatter="typeFormat" />
<el-table-column label="创建时间" align="center" prop="operTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.operTime) }}</span>
</template>
</el-table-column>
<el-table-column label="发送情况" align="center" prop="operId">
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
export default {
name: "Operlog",
data() {
return {
// 遮罩层
loading: false,
// 选中数组
ids: [],
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 表格数据
list: [],
// 是否显示弹出层
open: false,
// 类型数据字典
typeOptions: [],
// 类型数据字典
statusOptions: [],
// 日期范围
dateRange: [],
// 表单参数
form: {},
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
title: undefined,
operName: undefined,
businessType: undefined,
status: undefined,
},
};
},
created() {
this.getList();
this.getDicts("sys_oper_type").then((response) => {
this.typeOptions = response.data;
});
this.getDicts("sys_common_status").then((response) => {
this.statusOptions = response.data;
});
},
methods: {
/** 查询登录日志 */
getList() {
this.loading = false;
list(this.addDateRange(this.queryParams, this.dateRange)).then(
(response) => {
this.list = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
// 操作日志状态字典翻译
statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.status);
},
// 操作日志类型字典翻译
typeFormat(row, column) {
return this.selectDictLabel(this.typeOptions, row.businessType);
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.operId);
this.multiple = !selection.length;
},
/** 详细按钮操作 */
handleView(row) {
this.open = true;
this.form = row;
},
/** 删除按钮操作 */
handleDelete(row) {
const operIds = row.operId || this.ids;
this.$confirm(
'是否确认删除日志编号为"' + operIds + '"的数据项?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return delOperlog(operIds);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
},
/** 清空按钮操作 */
handleClean() {
this.$confirm("是否确认清空所有操作日志数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return cleanOperlog();
})
.then(() => {
this.getList();
this.msgSuccess("清空成功");
})
.catch(function () {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm("是否确认导出所有操作日志数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return exportOperlog(queryParams);
})
.then((response) => {
this.download(response.msg);
})
.catch(function () {});
},
},
};
</script>
\ No newline at end of file
<style lang="scss" scoped>
.img-wrap {
position: relative;
&:hover .el-upload-list__item-actions {
opacity: 1;
}
}
.el-upload-list__item-actions {
position: absolute;
width: 100%;
height: 50px;
left: 0;
top: 0;
cursor: default;
text-align: center;
color: #fff;
opacity: 0;
font-size: 20px;
background-color: rgba(0, 0, 0, 0.5);
transition: opacity 0.3s;
}
</style>
<template>
<div class="app-container">
<el-row :gutter="20">
<!--部门数据-->
<el-col :span="4" :xs="24">
<div class="head-container">
<el-input
v-model="deptName"
placeholder="请输入素材"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
<el-popover placement="top" width="160" v-model="visible">
<div>添加一级分类</div>
<el-select v-model="model" size="small" placeholder>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="visible = false">确定</el-button>
</div>
<el-button
slot="reference"
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>添加分类</el-button>
</el-popover>
</div>
<div class="head-container">
<el-tree
:data="deptOptions"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
default-expand-all
@node-click="handleNodeClick"
/>
</div>
</el-col>
<!--用户数据-->
<el-col :span="20" :xs="24">
<el-checkbox
:indeterminate="isIndeterminate"
v-model="checkAll"
@change="handleCheckAllChange"
>全选</el-checkbox>
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">添加</el-button>
<el-popover placement="top" width="160" v-model="visible">
<div>选择分组</div>
<el-select v-model="model" size="small" placeholder>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="visible = false">确定</el-button>
</div>
<el-button slot="reference">移动分组</el-button>
</el-popover>
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">删除</el-button>
<el-row :gutter="20">
<el-col :span="6" style="margin-top: 24px;" v-for="(item, index) in 10" :key="index">
<el-card shadow="hover" body-style="padding: 0px;">
<div class="img-wrap">
<el-image :src="require('@/assets/image/profile.jpg')" :preview-src-list="srcList"></el-image>
<div class="el-upload-list__item-actions">
<span class="el-upload-list__item-preview" @click="edit(file)">
<i class="el-icon-edit"></i>
</span>
<span class="el-upload-list__item-" @click="handleRemove(file)">
<i class="el-icon-delete"></i>
</span>
</div>
</div>
<div style="padding: 14px;">
<el-checkbox v-model="kl">sdghwery阿瑟他五色土</el-checkbox>
<div>sdghwery阿瑟他五色土</div>
</div>
</el-card>
</el-col>
</el-row>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<!-- 添加或修改参数配置对话框 -->
<el-dialog title="编辑网页" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="小程序标题">
<el-input v-model="sd" placeholder="请输入小程序标题"></el-input>
</el-form-item>
<el-form-item label="小程序appid">
<el-input style="width: 90%;margin-right: 10px" v-model="sd" placeholder="请输入小程序appid"></el-input>
<el-tooltip class="item" effect="dark" content="必须是关联到企业的小程序" placement="top">
<i class="el-icon-warning-outline"></i>
</el-tooltip>
</el-form-item>
<el-form-item label="小程序路径">
<el-input style="width: 90%;margin-right: 10px" v-model="sd" placeholder="请输入小程序page路径"></el-input>
<el-tooltip class="item" effect="dark" content="登录小程序管理后台,在数据分析中,可以查看主要的页面访问路径" placement="top">
<i class="el-icon-warning-outline"></i>
</el-tooltip>
</el-form-item>
<el-form-item label="小程序封面">
<el-upload action :show-file-list="false" :on-success="d" :before-upload="d">
<img v-if="imageUrl" :src="imageUrl" />
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<div>建议尺寸:520*416</div>
</el-form-item>
<el-form-item label="小程序分类">
<el-select v-model="model" placeholder>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Editor from "@/components/Editor";
export default {
components: {
Editor,
},
data() {
return {
model: 0,
srcList: [
"https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg",
"https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg",
],
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 用户表格数据
userList: null,
// 弹出层标题
title: "",
// 部门树选项
deptOptions: undefined,
// 是否显示弹出层
open: false,
// 部门名称
deptName: undefined,
// 默认密码
initPassword: undefined,
// 日期范围
dateRange: [],
// 状态数据字典
statusOptions: [],
// 性别状态字典
sexOptions: [],
// 岗位选项
postOptions: [],
// 角色选项
roleOptions: [],
// 表单参数
form: {},
defaultProps: {
children: "children",
label: "label",
},
// 用户导入参数
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: "",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/system/user/importData",
},
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
userName: undefined,
phonenumber: undefined,
status: undefined,
deptId: undefined,
},
// 表单校验
rules: {
userName: [
{ required: true, message: "用户名称不能为空", trigger: "blur" },
],
nickName: [
{ required: true, message: "用户昵称不能为空", trigger: "blur" },
],
deptId: [
{ required: true, message: "归属部门不能为空", trigger: "blur" },
],
password: [
{ required: true, message: "用户密码不能为空", trigger: "blur" },
],
email: [
{ required: true, message: "邮箱地址不能为空", trigger: "blur" },
{
type: "email",
message: "'请输入正确的邮箱地址",
trigger: ["blur", "change"],
},
],
phonenumber: [
{ required: true, message: "手机号码不能为空", trigger: "blur" },
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的手机号码",
trigger: "blur",
},
],
},
};
},
watch: {
// 根据名称筛选部门树
deptName(val) {
this.$refs.tree.filter(val);
},
},
created() {
this.getList();
this.getTreeselect();
this.getDicts("sys_normal_disable").then((response) => {
this.statusOptions = response.data;
});
this.getDicts("sys_user_sex").then((response) => {
this.sexOptions = response.data;
});
this.getConfigKey("sys.user.initPassword").then((response) => {
this.initPassword = response.msg;
});
},
methods: {
/** 查询用户列表 */
getList() {
this.loading = true;
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(
(response) => {
this.userList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 查询部门下拉树结构 */
getTreeselect() {
treeselect().then((response) => {
this.deptOptions = response.data;
});
},
// 筛选节点
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
// 节点单击事件
handleNodeClick(data) {
this.queryParams.deptId = data.id;
this.getList();
},
// 用户状态修改
handleStatusChange(row) {
let text = row.status === "0" ? "启用" : "停用";
this.$confirm(
'确认要"' + text + '""' + row.userName + '"用户吗?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return changeUserStatus(row.userId, row.status);
})
.then(() => {
this.msgSuccess(text + "成功");
})
.catch(function () {
row.status = row.status === "0" ? "1" : "0";
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
userId: undefined,
deptId: undefined,
userName: undefined,
nickName: undefined,
password: undefined,
phonenumber: undefined,
email: undefined,
sex: undefined,
status: "0",
remark: undefined,
postIds: [],
roleIds: [],
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.page = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.userId);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.getTreeselect();
getUser().then((response) => {
this.postOptions = response.posts;
this.roleOptions = response.roles;
this.open = true;
this.title = "添加用户";
this.form.password = this.initPassword;
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.getTreeselect();
const userId = row.userId || this.ids;
getUser(userId).then((response) => {
this.form = response.data;
this.postOptions = response.posts;
this.roleOptions = response.roles;
this.form.postIds = response.postIds;
this.form.roleIds = response.roleIds;
this.open = true;
this.title = "修改用户";
this.form.password = "";
});
},
/** 重置密码按钮操作 */
handleResetPwd(row) {
this.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
})
.then(({ value }) => {
resetUserPwd(row.userId, value).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功,新密码是:" + value);
}
});
})
.catch(() => {});
},
/** 提交按钮 */
submitForm: function () {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.userId != undefined) {
updateUser(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addUser(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const userIds = row.userId || this.ids;
this.$confirm(
'是否确认删除用户编号为"' + userIds + '"的数据项?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return delUser(userIds);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm("是否确认导出所有用户数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return exportUser(queryParams);
})
.then((response) => {
this.download(response.msg);
})
.catch(function () {});
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "用户导入";
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
importTemplate().then((response) => {
this.download(response.msg);
});
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
},
edit() {
this.open = true;
},
},
};
</script>
\ No newline at end of file
<template>
<div class="app-container">
<el-row :gutter="20">
<!--部门数据-->
<el-col :span="4" :xs="24">
<div class="head-container">
<el-input
v-model="deptName"
placeholder="请输入素材"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</div>
<div class="head-container">
<el-tree
:data="deptOptions"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
default-expand-all
@node-click="handleNodeClick"
/>
</div>
</el-col>
<!--用户数据-->
<el-col :span="20" :xs="24">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="open = true"
>添加</el-button>
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>移动分组</el-button>
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>删除</el-button>
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" />
<el-table-column
label="语音"
align="center"
prop="userName"
/>
<el-table-column
label="时长"
align="center"
prop="userName"
:show-overflow-tooltip="true"
/>
<el-table-column label="创建时间" align="center" prop="createTime" width="160">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
width="180"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-key"
@click="handleResetPwd(scope.row)"
v-hasPermi="['system:user:resetPwd']"
>下载</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:user:edit']"
>修改</el-button>
<el-button
v-if="scope.row.userId !== 1"
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:user:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<!-- 添加或修改参数配置对话框 -->
<el-dialog title="添加语音" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="分类">
<el-select v-model="form.sex" placeholder="请选择">
<el-option
v-for="dict in sexOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="语音">
<el-upload
action=""
:on-remove="d"
:before-remove="d"
multiple
:limit="3"
:on-exceed="d"
:file-list="[{name: 'name', url: 'url'}]">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传amr格式的语音文件。单个文件大小不超过2M,时长不超过1分钟</div>
</el-upload>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
components: {},
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 用户表格数据
userList: null,
// 弹出层标题
title: "",
// 部门树选项
deptOptions: undefined,
// 是否显示弹出层
open: false,
// 部门名称
deptName: undefined,
// 默认密码
initPassword: undefined,
// 日期范围
dateRange: [],
// 状态数据字典
statusOptions: [],
// 性别状态字典
sexOptions: [],
// 岗位选项
postOptions: [],
// 角色选项
roleOptions: [],
// 表单参数
form: {},
defaultProps: {
children: "children",
label: "label",
},
// 用户导入参数
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: "",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/system/user/importData",
},
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
userName: undefined,
phonenumber: undefined,
status: undefined,
deptId: undefined,
},
// 表单校验
rules: {
userName: [
{ required: true, message: "用户名称不能为空", trigger: "blur" },
],
nickName: [
{ required: true, message: "用户昵称不能为空", trigger: "blur" },
],
deptId: [
{ required: true, message: "归属部门不能为空", trigger: "blur" },
],
password: [
{ required: true, message: "用户密码不能为空", trigger: "blur" },
],
email: [
{ required: true, message: "邮箱地址不能为空", trigger: "blur" },
{
type: "email",
message: "'请输入正确的邮箱地址",
trigger: ["blur", "change"],
},
],
phonenumber: [
{ required: true, message: "手机号码不能为空", trigger: "blur" },
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的手机号码",
trigger: "blur",
},
],
},
};
},
watch: {
// 根据名称筛选部门树
deptName(val) {
this.$refs.tree.filter(val);
},
},
created() {
this.getList();
this.getTreeselect();
this.getDicts("sys_normal_disable").then((response) => {
this.statusOptions = response.data;
});
this.getDicts("sys_user_sex").then((response) => {
this.sexOptions = response.data;
});
this.getConfigKey("sys.user.initPassword").then((response) => {
this.initPassword = response.msg;
});
},
methods: {
/** 查询用户列表 */
getList() {
this.loading = false;
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(
(response) => {
this.userList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 查询部门下拉树结构 */
getTreeselect() {
treeselect().then((response) => {
this.deptOptions = response.data;
});
},
// 筛选节点
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
// 节点单击事件
handleNodeClick(data) {
this.queryParams.deptId = data.id;
this.getList();
},
// 用户状态修改
handleStatusChange(row) {
let text = row.status === "0" ? "启用" : "停用";
this.$confirm(
'确认要"' + text + '""' + row.userName + '"用户吗?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return changeUserStatus(row.userId, row.status);
})
.then(() => {
this.msgSuccess(text + "成功");
})
.catch(function () {
row.status = row.status === "0" ? "1" : "0";
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
userId: undefined,
deptId: undefined,
userName: undefined,
nickName: undefined,
password: undefined,
phonenumber: undefined,
email: undefined,
sex: undefined,
status: "0",
remark: undefined,
postIds: [],
roleIds: [],
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.page = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.userId);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.getTreeselect();
getUser().then((response) => {
this.postOptions = response.posts;
this.roleOptions = response.roles;
this.open = true;
this.title = "添加用户";
this.form.password = this.initPassword;
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.getTreeselect();
const userId = row.userId || this.ids;
getUser(userId).then((response) => {
this.form = response.data;
this.postOptions = response.posts;
this.roleOptions = response.roles;
this.form.postIds = response.postIds;
this.form.roleIds = response.roleIds;
this.open = true;
this.title = "修改用户";
this.form.password = "";
});
},
/** 重置密码按钮操作 */
handleResetPwd(row) {
this.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
})
.then(({ value }) => {
resetUserPwd(row.userId, value).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功,新密码是:" + value);
}
});
})
.catch(() => {});
},
/** 提交按钮 */
submitForm: function () {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.userId != undefined) {
updateUser(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addUser(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const userIds = row.userId || this.ids;
this.$confirm(
'是否确认删除用户编号为"' + userIds + '"的数据项?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return delUser(userIds);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm("是否确认导出所有用户数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return exportUser(queryParams);
})
.then((response) => {
this.download(response.msg);
})
.catch(function () {});
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "用户导入";
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
importTemplate().then((response) => {
this.download(response.msg);
});
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
},
},
};
</script>
\ No newline at end of file
<template>
<div class="app-container">
<el-row :gutter="20">
<!--部门数据-->
<el-col :span="4" :xs="24">
<div class="head-container">
<el-input
v-model="deptName"
placeholder="请输入文本素材"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</div>
<div class="head-container">
<el-tree
:data="deptOptions"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
default-expand-all
@node-click="handleNodeClick"
/>
</div>
</el-col>
<!--用户数据-->
<el-col :span="20" :xs="24">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="open = true"
>添加</el-button>
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>移动分组</el-button>
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>删除</el-button>
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" />
<el-table-column
label="文件名"
align="center"
prop="userName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="大小"
align="center"
prop="userName"
/>
<el-table-column label="创建时间" align="center" prop="createTime" width="160">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
width="180"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-key"
@click="handleResetPwd(scope.row)"
v-hasPermi="['system:user:resetPwd']"
>下载</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:user:edit']"
>修改</el-button>
<el-button
v-if="scope.row.userId !== 1"
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:user:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<!-- 添加或修改参数配置对话框 -->
<el-dialog title="添加文件" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="分类">
<el-select v-model="form.sex" placeholder="请选择">
<el-option
v-for="dict in sexOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="文件">
<el-upload
action=""
:on-remove="d"
:before-remove="d"
multiple
:limit="3"
:on-exceed="d"
:file-list="[{name: 'name', url: 'url'}]">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">单个文件大小不超过20M</div>
</el-upload>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
components: {},
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 用户表格数据
userList: null,
// 弹出层标题
title: "",
// 部门树选项
deptOptions: undefined,
// 是否显示弹出层
open: false,
// 部门名称
deptName: undefined,
// 默认密码
initPassword: undefined,
// 日期范围
dateRange: [],
// 状态数据字典
statusOptions: [],
// 性别状态字典
sexOptions: [],
// 岗位选项
postOptions: [],
// 角色选项
roleOptions: [],
// 表单参数
form: {},
defaultProps: {
children: "children",
label: "label",
},
// 用户导入参数
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: "",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/system/user/importData",
},
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
userName: undefined,
phonenumber: undefined,
status: undefined,
deptId: undefined,
},
// 表单校验
rules: {
userName: [
{ required: true, message: "用户名称不能为空", trigger: "blur" },
],
nickName: [
{ required: true, message: "用户昵称不能为空", trigger: "blur" },
],
deptId: [
{ required: true, message: "归属部门不能为空", trigger: "blur" },
],
password: [
{ required: true, message: "用户密码不能为空", trigger: "blur" },
],
email: [
{ required: true, message: "邮箱地址不能为空", trigger: "blur" },
{
type: "email",
message: "'请输入正确的邮箱地址",
trigger: ["blur", "change"],
},
],
phonenumber: [
{ required: true, message: "手机号码不能为空", trigger: "blur" },
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的手机号码",
trigger: "blur",
},
],
},
};
},
watch: {
// 根据名称筛选部门树
deptName(val) {
this.$refs.tree.filter(val);
},
},
created() {
this.getList();
this.getTreeselect();
this.getDicts("sys_normal_disable").then((response) => {
this.statusOptions = response.data;
});
this.getDicts("sys_user_sex").then((response) => {
this.sexOptions = response.data;
});
this.getConfigKey("sys.user.initPassword").then((response) => {
this.initPassword = response.msg;
});
},
methods: {
/** 查询用户列表 */
getList() {
this.loading = false;
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(
(response) => {
this.userList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 查询部门下拉树结构 */
getTreeselect() {
treeselect().then((response) => {
this.deptOptions = response.data;
});
},
// 筛选节点
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
// 节点单击事件
handleNodeClick(data) {
this.queryParams.deptId = data.id;
this.getList();
},
// 用户状态修改
handleStatusChange(row) {
let text = row.status === "0" ? "启用" : "停用";
this.$confirm(
'确认要"' + text + '""' + row.userName + '"用户吗?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return changeUserStatus(row.userId, row.status);
})
.then(() => {
this.msgSuccess(text + "成功");
})
.catch(function () {
row.status = row.status === "0" ? "1" : "0";
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
userId: undefined,
deptId: undefined,
userName: undefined,
nickName: undefined,
password: undefined,
phonenumber: undefined,
email: undefined,
sex: undefined,
status: "0",
remark: undefined,
postIds: [],
roleIds: [],
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.page = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.userId);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.getTreeselect();
getUser().then((response) => {
this.postOptions = response.posts;
this.roleOptions = response.roles;
this.open = true;
this.title = "添加用户";
this.form.password = this.initPassword;
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.getTreeselect();
const userId = row.userId || this.ids;
getUser(userId).then((response) => {
this.form = response.data;
this.postOptions = response.posts;
this.roleOptions = response.roles;
this.form.postIds = response.postIds;
this.form.roleIds = response.roleIds;
this.open = true;
this.title = "修改用户";
this.form.password = "";
});
},
/** 重置密码按钮操作 */
handleResetPwd(row) {
this.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
})
.then(({ value }) => {
resetUserPwd(row.userId, value).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功,新密码是:" + value);
}
});
})
.catch(() => {});
},
/** 提交按钮 */
submitForm: function () {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.userId != undefined) {
updateUser(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addUser(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const userIds = row.userId || this.ids;
this.$confirm(
'是否确认删除用户编号为"' + userIds + '"的数据项?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return delUser(userIds);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm("是否确认导出所有用户数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return exportUser(queryParams);
})
.then((response) => {
this.download(response.msg);
})
.catch(function () {});
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "用户导入";
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
importTemplate().then((response) => {
this.download(response.msg);
});
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
},
},
};
</script>
\ No newline at end of file
<style lang="scss" scoped>
.img-wrap {
position: relative;
&:hover .el-upload-list__item-actions {
opacity: 1;
}
}
.el-upload-list__item-actions {
position: absolute;
width: 100%;
height: 50px;
left: 0;
top: 0;
cursor: default;
text-align: center;
color: #fff;
opacity: 0;
font-size: 20px;
background-color: rgba(0, 0, 0, 0.5);
transition: opacity 0.3s;
}
</style>
<template>
<div class="app-container">
<el-row :gutter="20">
<!--部门数据-->
<el-col :span="4" :xs="24">
<div class="head-container">
<el-input
v-model="deptName"
placeholder="请输入素材"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
<el-popover placement="top" width="160" v-model="visible">
<div>添加一级分类</div>
<el-select v-model="model" size="small" placeholder>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="visible = false">确定</el-button>
</div>
<el-button
slot="reference"
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>添加分类</el-button>
</el-popover>
</div>
<div class="head-container">
<el-tree
:data="deptOptions"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
default-expand-all
@node-click="handleNodeClick"
/>
</div>
</el-col>
<!--用户数据-->
<el-col :span="20" :xs="24">
<el-checkbox
:indeterminate="isIndeterminate"
v-model="checkAll"
@change="handleCheckAllChange"
>全选</el-checkbox>
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">添加图片</el-button>
<el-popover placement="top" width="160" v-model="visible">
<div>选择分组</div>
<el-select v-model="model" size="small" placeholder>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="visible = false">确定</el-button>
</div>
<el-button slot="reference">移动分组</el-button>
</el-popover>
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">删除</el-button>
<el-row :gutter="20">
<el-col :span="6" style="margin-top: 24px;" v-for="(item, index) in 10" :key="index">
<el-card shadow="hover" body-style="padding: 0px;">
<div class="img-wrap">
<el-image :src="require('@/assets/image/profile.jpg')" :preview-src-list="srcList"></el-image>
<div class="el-upload-list__item-actions">
<span class="el-upload-list__item-preview" @click="edit(file)">
<i class="el-icon-edit"></i>
</span>
<span class="el-upload-list__item-" @click="handleRemove(file)">
<i class="el-icon-delete"></i>
</span>
</div>
</div>
<div style="padding: 14px;">
<el-checkbox v-model="kl">16545awfe.jpg</el-checkbox>
</div>
</el-card>
</el-col>
</el-row>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<!-- 添加或修改参数配置对话框 -->
<el-dialog title="编辑图片" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="图片名称">
<el-input v-model="sd" placeholder></el-input>
</el-form-item>
<el-form-item label="图片文案">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
</el-form-item>
<el-form-item label="图片">
<el-upload action :show-file-list="false" :on-success="d" :before-upload="d">
<img v-if="imageUrl" :src="imageUrl" />
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<div>支持JPG,PNG格式,图片大小不超过2M,建议上传宽高1:1的图片</div>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
components: {},
data() {
return {
srcList: [
"https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg",
"https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg",
],
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 用户表格数据
userList: null,
// 弹出层标题
title: "",
// 部门树选项
deptOptions: undefined,
// 是否显示弹出层
open: false,
// 部门名称
deptName: undefined,
// 默认密码
initPassword: undefined,
// 日期范围
dateRange: [],
// 状态数据字典
statusOptions: [],
// 性别状态字典
sexOptions: [],
// 岗位选项
postOptions: [],
// 角色选项
roleOptions: [],
// 表单参数
form: {},
defaultProps: {
children: "children",
label: "label",
},
// 用户导入参数
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: "",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/system/user/importData",
},
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
userName: undefined,
phonenumber: undefined,
status: undefined,
deptId: undefined,
},
// 表单校验
rules: {
userName: [
{ required: true, message: "用户名称不能为空", trigger: "blur" },
],
nickName: [
{ required: true, message: "用户昵称不能为空", trigger: "blur" },
],
deptId: [
{ required: true, message: "归属部门不能为空", trigger: "blur" },
],
password: [
{ required: true, message: "用户密码不能为空", trigger: "blur" },
],
email: [
{ required: true, message: "邮箱地址不能为空", trigger: "blur" },
{
type: "email",
message: "'请输入正确的邮箱地址",
trigger: ["blur", "change"],
},
],
phonenumber: [
{ required: true, message: "手机号码不能为空", trigger: "blur" },
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的手机号码",
trigger: "blur",
},
],
},
};
},
watch: {
// 根据名称筛选部门树
deptName(val) {
this.$refs.tree.filter(val);
},
},
created() {
this.getList();
this.getTreeselect();
this.getDicts("sys_normal_disable").then((response) => {
this.statusOptions = response.data;
});
this.getDicts("sys_user_sex").then((response) => {
this.sexOptions = response.data;
});
this.getConfigKey("sys.user.initPassword").then((response) => {
this.initPassword = response.msg;
});
},
methods: {
/** 查询用户列表 */
getList() {
this.loading = true;
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(
(response) => {
this.userList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 查询部门下拉树结构 */
getTreeselect() {
treeselect().then((response) => {
this.deptOptions = response.data;
});
},
// 筛选节点
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
// 节点单击事件
handleNodeClick(data) {
this.queryParams.deptId = data.id;
this.getList();
},
// 用户状态修改
handleStatusChange(row) {
let text = row.status === "0" ? "启用" : "停用";
this.$confirm(
'确认要"' + text + '""' + row.userName + '"用户吗?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return changeUserStatus(row.userId, row.status);
})
.then(() => {
this.msgSuccess(text + "成功");
})
.catch(function () {
row.status = row.status === "0" ? "1" : "0";
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
userId: undefined,
deptId: undefined,
userName: undefined,
nickName: undefined,
password: undefined,
phonenumber: undefined,
email: undefined,
sex: undefined,
status: "0",
remark: undefined,
postIds: [],
roleIds: [],
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.page = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.userId);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.getTreeselect();
getUser().then((response) => {
this.postOptions = response.posts;
this.roleOptions = response.roles;
this.open = true;
this.title = "添加用户";
this.form.password = this.initPassword;
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.getTreeselect();
const userId = row.userId || this.ids;
getUser(userId).then((response) => {
this.form = response.data;
this.postOptions = response.posts;
this.roleOptions = response.roles;
this.form.postIds = response.postIds;
this.form.roleIds = response.roleIds;
this.open = true;
this.title = "修改用户";
this.form.password = "";
});
},
/** 重置密码按钮操作 */
handleResetPwd(row) {
this.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
})
.then(({ value }) => {
resetUserPwd(row.userId, value).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功,新密码是:" + value);
}
});
})
.catch(() => {});
},
/** 提交按钮 */
submitForm: function () {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.userId != undefined) {
updateUser(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addUser(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const userIds = row.userId || this.ids;
this.$confirm(
'是否确认删除用户编号为"' + userIds + '"的数据项?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return delUser(userIds);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm("是否确认导出所有用户数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return exportUser(queryParams);
})
.then((response) => {
this.download(response.msg);
})
.catch(function () {});
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "用户导入";
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
importTemplate().then((response) => {
this.download(response.msg);
});
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
},
edit() {
this.open = true;
},
},
};
</script>
\ No newline at end of file
<template>
<div class="app-container">
<el-row :gutter="20">
<!--部门数据-->
<el-col :span="4" :xs="24">
<div class="head-container">
<el-input
v-model="deptName"
placeholder="请输入文本素材"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</div>
<div class="head-container">
<el-tree
:data="deptOptions"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
default-expand-all
@node-click="handleNodeClick"
/>
</div>
</el-col>
<!--用户数据-->
<el-col :span="20" :xs="24">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:user:add']"
>新增文本</el-button>
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:user:add']"
>移动分组</el-button>
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:user:add']"
>删除</el-button>
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" />
<el-table-column
label="文本内容"
align="center"
prop="userName"
:show-overflow-tooltip="true"
/>
<el-table-column label="创建时间" align="center" prop="createTime" width="160">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
width="180"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:user:edit']"
>修改</el-button>
<el-button
v-if="scope.row.userId !== 1"
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:user:remove']"
>删除</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-key"
@click="handleResetPwd(scope.row)"
v-hasPermi="['system:user:resetPwd']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<!-- 添加或修改对话框 -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="文本分类">
<el-select v-model="form.sex" placeholder="请选择">
<el-option
v-for="dict in sexOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="文本内容">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
components: {},
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 用户表格数据
userList: null,
// 弹出层标题
title: "",
// 部门树选项
deptOptions: undefined,
// 是否显示弹出层
open: false,
// 部门名称
deptName: undefined,
// 默认密码
initPassword: undefined,
// 日期范围
dateRange: [],
// 状态数据字典
statusOptions: [],
// 性别状态字典
sexOptions: [],
// 岗位选项
postOptions: [],
// 角色选项
roleOptions: [],
// 表单参数
form: {},
defaultProps: {
children: "children",
label: "label",
},
// 用户导入参数
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: "",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/system/user/importData",
},
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
userName: undefined,
phonenumber: undefined,
status: undefined,
deptId: undefined,
},
// 表单校验
rules: {
userName: [
{ required: true, message: "用户名称不能为空", trigger: "blur" },
],
nickName: [
{ required: true, message: "用户昵称不能为空", trigger: "blur" },
],
deptId: [
{ required: true, message: "归属部门不能为空", trigger: "blur" },
],
password: [
{ required: true, message: "用户密码不能为空", trigger: "blur" },
],
email: [
{ required: true, message: "邮箱地址不能为空", trigger: "blur" },
{
type: "email",
message: "'请输入正确的邮箱地址",
trigger: ["blur", "change"],
},
],
phonenumber: [
{ required: true, message: "手机号码不能为空", trigger: "blur" },
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的手机号码",
trigger: "blur",
},
],
},
};
},
watch: {
// 根据名称筛选部门树
deptName(val) {
this.$refs.tree.filter(val);
},
},
created() {
this.getList();
this.getTreeselect();
this.getDicts("sys_normal_disable").then((response) => {
this.statusOptions = response.data;
});
this.getDicts("sys_user_sex").then((response) => {
this.sexOptions = response.data;
});
this.getConfigKey("sys.user.initPassword").then((response) => {
this.initPassword = response.msg;
});
},
methods: {
/** 查询用户列表 */
getList() {
this.loading = true;
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(
(response) => {
this.userList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 查询部门下拉树结构 */
getTreeselect() {
treeselect().then((response) => {
this.deptOptions = response.data;
});
},
// 筛选节点
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
// 节点单击事件
handleNodeClick(data) {
this.queryParams.deptId = data.id;
this.getList();
},
// 用户状态修改
handleStatusChange(row) {
let text = row.status === "0" ? "启用" : "停用";
this.$confirm(
'确认要"' + text + '""' + row.userName + '"用户吗?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return changeUserStatus(row.userId, row.status);
})
.then(() => {
this.msgSuccess(text + "成功");
})
.catch(function () {
row.status = row.status === "0" ? "1" : "0";
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
userId: undefined,
deptId: undefined,
userName: undefined,
nickName: undefined,
password: undefined,
phonenumber: undefined,
email: undefined,
sex: undefined,
status: "0",
remark: undefined,
postIds: [],
roleIds: [],
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.page = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.userId);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.getTreeselect();
getUser().then((response) => {
this.postOptions = response.posts;
this.roleOptions = response.roles;
this.open = true;
this.title = "添加用户";
this.form.password = this.initPassword;
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.getTreeselect();
const userId = row.userId || this.ids;
getUser(userId).then((response) => {
this.form = response.data;
this.postOptions = response.posts;
this.roleOptions = response.roles;
this.form.postIds = response.postIds;
this.form.roleIds = response.roleIds;
this.open = true;
this.title = "修改用户";
this.form.password = "";
});
},
/** 重置密码按钮操作 */
handleResetPwd(row) {
this.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
})
.then(({ value }) => {
resetUserPwd(row.userId, value).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功,新密码是:" + value);
}
});
})
.catch(() => {});
},
/** 提交按钮 */
submitForm: function () {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.userId != undefined) {
updateUser(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addUser(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const userIds = row.userId || this.ids;
this.$confirm(
'是否确认删除用户编号为"' + userIds + '"的数据项?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return delUser(userIds);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm("是否确认导出所有用户数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return exportUser(queryParams);
})
.then((response) => {
this.download(response.msg);
})
.catch(function () {});
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "用户导入";
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
importTemplate().then((response) => {
this.download(response.msg);
});
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
},
},
};
</script>
\ No newline at end of file
<style lang="scss" scoped>
.img-wrap {
position: relative;
&:hover .el-upload-list__item-actions {
opacity: 1;
}
}
.el-upload-list__item-actions {
position: absolute;
width: 100%;
height: 50px;
left: 0;
top: 0;
cursor: default;
text-align: center;
color: #fff;
opacity: 0;
font-size: 20px;
background-color: rgba(0, 0, 0, 0.5);
transition: opacity 0.3s;
}
</style>
<template>
<div class="app-container">
<el-row :gutter="20">
<!--部门数据-->
<el-col :span="4" :xs="24">
<div class="head-container">
<el-input
v-model="deptName"
placeholder="请输入素材"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
<el-popover placement="top" width="160" v-model="visible">
<div>添加一级分类</div>
<el-select v-model="model" size="small" placeholder>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="visible = false">确定</el-button>
</div>
<el-button
slot="reference"
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>添加分类</el-button>
</el-popover>
</div>
<div class="head-container">
<el-tree
:data="deptOptions"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
default-expand-all
@node-click="handleNodeClick"
/>
</div>
</el-col>
<!--用户数据-->
<el-col :span="20" :xs="24">
<el-checkbox
:indeterminate="isIndeterminate"
v-model="checkAll"
@change="handleCheckAllChange"
>全选</el-checkbox>
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">添加网页</el-button>
<el-popover placement="top" width="160" v-model="visible">
<div>选择分组</div>
<el-select v-model="model" size="small" placeholder>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="visible = false">确定</el-button>
</div>
<el-button slot="reference">移动分组</el-button>
</el-popover>
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">删除</el-button>
<el-row :gutter="20">
<el-col :span="6" style="margin-top: 24px;" v-for="(item, index) in 10" :key="index">
<el-card shadow="hover" body-style="padding: 0px;">
<div class="img-wrap">
<el-image :src="require('@/assets/image/profile.jpg')" :preview-src-list="srcList"></el-image>
<div class="el-upload-list__item-actions">
<span class="el-upload-list__item-preview" @click="edit(file)">
<i class="el-icon-download"></i>
</span>
<span class="el-upload-list__item-preview" @click="edit(file)">
<i class="el-icon-edit"></i>
</span>
<span class="el-upload-list__item-" @click="handleRemove(file)">
<i class="el-icon-delete"></i>
</span>
</div>
</div>
<div style="padding: 14px;">
<el-checkbox v-model="kl">2020-02-02</el-checkbox>
<div>sdghwery阿瑟他五色土</div>
<div>sdghwery阿瑟他五色土</div>
</div>
</el-card>
</el-col>
</el-row>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<!-- 添加或修改参数配置对话框 -->
<el-dialog title="编辑网页" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="分类">
<el-select v-model="model" placeholder="">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="视频">
<el-upload action :show-file-list="false" :on-success="d" :before-upload="d">
<img v-if="imageUrl" :src="imageUrl" />
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<div>不超过10M, 文件格式: mp4</div>
</el-form-item>
<el-form-item label="封面">
<el-upload action :show-file-list="false" :on-success="d" :before-upload="d">
<img v-if="imageUrl" :src="imageUrl" />
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<div>建议尺寸:1068*455</div>
</el-form-item>
<el-form-item label="摘要">
<el-input v-model="form.remark" type="textarea" placeholder="非必填,限120字,如不填会自动抓取正文前54个字"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Editor from '@/components/Editor';
export default {
components: {
Editor
},
data() {
return {
model: 0,
srcList: [
"https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg",
"https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg",
],
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 用户表格数据
userList: null,
// 弹出层标题
title: "",
// 部门树选项
deptOptions: undefined,
// 是否显示弹出层
open: false,
// 部门名称
deptName: undefined,
// 默认密码
initPassword: undefined,
// 日期范围
dateRange: [],
// 状态数据字典
statusOptions: [],
// 性别状态字典
sexOptions: [],
// 岗位选项
postOptions: [],
// 角色选项
roleOptions: [],
// 表单参数
form: {},
defaultProps: {
children: "children",
label: "label",
},
// 用户导入参数
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: "",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/system/user/importData",
},
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
userName: undefined,
phonenumber: undefined,
status: undefined,
deptId: undefined,
},
// 表单校验
rules: {
userName: [
{ required: true, message: "用户名称不能为空", trigger: "blur" },
],
nickName: [
{ required: true, message: "用户昵称不能为空", trigger: "blur" },
],
deptId: [
{ required: true, message: "归属部门不能为空", trigger: "blur" },
],
password: [
{ required: true, message: "用户密码不能为空", trigger: "blur" },
],
email: [
{ required: true, message: "邮箱地址不能为空", trigger: "blur" },
{
type: "email",
message: "'请输入正确的邮箱地址",
trigger: ["blur", "change"],
},
],
phonenumber: [
{ required: true, message: "手机号码不能为空", trigger: "blur" },
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的手机号码",
trigger: "blur",
},
],
},
};
},
watch: {
// 根据名称筛选部门树
deptName(val) {
this.$refs.tree.filter(val);
},
},
created() {
this.getList();
this.getTreeselect();
this.getDicts("sys_normal_disable").then((response) => {
this.statusOptions = response.data;
});
this.getDicts("sys_user_sex").then((response) => {
this.sexOptions = response.data;
});
this.getConfigKey("sys.user.initPassword").then((response) => {
this.initPassword = response.msg;
});
},
methods: {
/** 查询用户列表 */
getList() {
this.loading = true;
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(
(response) => {
this.userList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 查询部门下拉树结构 */
getTreeselect() {
treeselect().then((response) => {
this.deptOptions = response.data;
});
},
// 筛选节点
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
// 节点单击事件
handleNodeClick(data) {
this.queryParams.deptId = data.id;
this.getList();
},
// 用户状态修改
handleStatusChange(row) {
let text = row.status === "0" ? "启用" : "停用";
this.$confirm(
'确认要"' + text + '""' + row.userName + '"用户吗?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return changeUserStatus(row.userId, row.status);
})
.then(() => {
this.msgSuccess(text + "成功");
})
.catch(function () {
row.status = row.status === "0" ? "1" : "0";
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
userId: undefined,
deptId: undefined,
userName: undefined,
nickName: undefined,
password: undefined,
phonenumber: undefined,
email: undefined,
sex: undefined,
status: "0",
remark: undefined,
postIds: [],
roleIds: [],
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.page = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.userId);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.getTreeselect();
getUser().then((response) => {
this.postOptions = response.posts;
this.roleOptions = response.roles;
this.open = true;
this.title = "添加用户";
this.form.password = this.initPassword;
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.getTreeselect();
const userId = row.userId || this.ids;
getUser(userId).then((response) => {
this.form = response.data;
this.postOptions = response.posts;
this.roleOptions = response.roles;
this.form.postIds = response.postIds;
this.form.roleIds = response.roleIds;
this.open = true;
this.title = "修改用户";
this.form.password = "";
});
},
/** 重置密码按钮操作 */
handleResetPwd(row) {
this.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
})
.then(({ value }) => {
resetUserPwd(row.userId, value).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功,新密码是:" + value);
}
});
})
.catch(() => {});
},
/** 提交按钮 */
submitForm: function () {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.userId != undefined) {
updateUser(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addUser(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const userIds = row.userId || this.ids;
this.$confirm(
'是否确认删除用户编号为"' + userIds + '"的数据项?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return delUser(userIds);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm("是否确认导出所有用户数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return exportUser(queryParams);
})
.then((response) => {
this.download(response.msg);
})
.catch(function () {});
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "用户导入";
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
importTemplate().then((response) => {
this.download(response.msg);
});
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
},
edit() {
this.open = true;
},
},
};
</script>
\ No newline at end of file
此差异已折叠。
package com.linkwechat.wecom.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.linkwechat.common.core.domain.BaseEntity;
import com.linkwechat.common.utils.SnowFlakeUtil;
......@@ -25,12 +26,13 @@ import javax.validation.constraints.NotNull;
@AllArgsConstructor
@NoArgsConstructor
@TableName("we_department")
public class WeDepartment extends BaseEntity
public class WeDepartment
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id= SnowFlakeUtil.nextId();
@TableId
private Long id;
/** 部门名称 */
......
......@@ -77,4 +77,9 @@ public class WeFlowerCustomerRel
@TableField(exist = false)
private List<WeFlowerCustomerTagRel> weFlowerCustomerTagRels;
@TableField(exist = false)
private String department;
}
......@@ -47,4 +47,7 @@ public class WeFlowerCustomerTagRel
private Date createTime;
}
......@@ -40,6 +40,7 @@ public class WeGroupMember {
@JsonFormat(pattern = "yyyy-MM-dd")
private Date joinTime;
/**入群方式: 1 - 由成员邀请入群(直接邀请入群) ; 2 - 由成员邀请入群(通过邀请链接入群); 3 - 通过扫描群二维码入群 */
private Integer joinScene;
@TableField(value="type")
......
......@@ -31,7 +31,7 @@ public class CustomerGroupDetail extends WeResultDto {
private String owner;
/**群的创建时间*/
private Date create_time;
private long create_time;
/**群公告*/
private String notice;
......
......@@ -18,7 +18,7 @@ public class CustomerGroupMember {
private Integer type;
/**入群时间*/
private Date join_time;
private long join_time;
/**1 - 由成员邀请入群(直接邀请入群);2 - 由成员邀请入群(通过邀请链接入群);3 - 通过扫描群二维码入群*/
private Integer join_scene;
......
......@@ -55,7 +55,7 @@ public class ExternalUserDetail extends WeResultDto {
/**该成员对此外部联系人的描述*/
private String description;
/**该成员添加此外部联系人的时间*/
private Date createtime;
private long createtime;
/**该成员对此客户备注的企业名称*/
private String remark_company;
/**该成员对此客户备注的手机号码*/
......
......@@ -35,7 +35,7 @@ public interface IWeDepartmentService extends IService<WeDepartment>
* @param weDepartment 企业微信组织架构相关
* @return 结果
*/
public int insertWeDepartment(WeDepartment weDepartment);
public void insertWeDepartment(WeDepartment weDepartment);
/**
* 修改企业微信组织架构相关
......@@ -43,7 +43,7 @@ public interface IWeDepartmentService extends IService<WeDepartment>
* @param weDepartment 企业微信组织架构相关
* @return 结果
*/
public int updateWeDepartment(WeDepartment weDepartment);
public void updateWeDepartment(WeDepartment weDepartment);
......
......@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linkwechat.common.constant.WeConstans;
import com.linkwechat.common.utils.DateUtils;
import com.linkwechat.common.utils.SecurityUtils;
import com.linkwechat.common.utils.SnowFlakeUtil;
import com.linkwechat.common.utils.bean.BeanUtils;
......@@ -71,11 +72,6 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper,WeCustom
private IWeAllocateCustomerService iWeAllocateCustomerService;
@Autowired
private WeUserClient weUserClient;
......@@ -149,12 +145,24 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper,WeCustom
List<WeFlowerCustomerTagRel> weFlowerCustomerTagRels=new ArrayList<>();
List<WeFlowerCustomerRel> weFlowerCustomerRel=new ArrayList<>();
externalUserDetail.getFollow_user().stream().forEach(kk->{
WeFlowerCustomerRel weFlowerCustomerRelOne=new WeFlowerCustomerRel();
BeanUtils.copyPropertiesignoreOther(kk,weFlowerCustomerRelOne);
// WeFlowerCustomerRel weFlowerCustomerRelOne=new WeFlowerCustomerRel();
// BeanUtils.copyPropertiesignoreOther(kk,weFlowerCustomerRelOne);
Long weFlowerCustomerRelId=SnowFlakeUtil.nextId();
weFlowerCustomerRelOne.setId(weFlowerCustomerRelId);
weFlowerCustomerRelOne.setExternalUserid(weCustomer.getExternalUserid());
weFlowerCustomerRel.add(weFlowerCustomerRelOne);
// weFlowerCustomerRelOne.setId(weFlowerCustomerRelId);
// weFlowerCustomerRelOne.setExternalUserid(weCustomer.getExternalUserid());
weFlowerCustomerRel.add(WeFlowerCustomerRel.builder()
.id(weFlowerCustomerRelId)
.userId(kk.getUserid())
.description(kk.getDescription())
.remarkCorpName(kk.getRemark_company())
.remarkMobiles(kk.getRemark_mobiles())
.operUserid(kk.getOper_userid())
.addWay(kk.getAdd_way())
.externalUserid(weCustomer.getExternalUserid())
.createTime(new Date(kk.getCreatetime() * 1000L))
.build());
List<ExternalUserTag> tags = kk.getTags();
if(CollectionUtil.isNotEmpty(tags)){
......@@ -339,7 +347,9 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper,WeCustom
List<WeTag> addTags = weMakeCustomerTag.getAddTag();
if(CollectionUtil.isNotEmpty(addTags)){
addTags.removeAll(Collections.singleton(null));
List<WeFlowerCustomerTagRel> tagRels=new ArrayList<>();
List<CutomerTagEdit> cutomerTagEdits=new ArrayList<>();
......@@ -393,15 +403,24 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper,WeCustom
if(CollectionUtil.isNotEmpty(addTags)){
//获取当前客户需要移除的标签
List<WeFlowerCustomerTagRel> removeTag = iWeFlowerCustomerTagRelService.list(new LambdaQueryWrapper<WeFlowerCustomerTagRel>()
.in(WeFlowerCustomerTagRel::getFlowerCustomerRelId, iWeFlowerCustomerRelService.list(new LambdaQueryWrapper<WeFlowerCustomerRel>().eq(WeFlowerCustomerRel::getExternalUserid
, weMakeCustomerTag.getExternalUserid())).stream().map(WeFlowerCustomerRel::getId).collect(Collectors.toList()))
.notIn(WeFlowerCustomerTagRel::getTagId, addTags.stream().map(WeTag::getTagId).collect(Collectors.toList()))
);
//查询出当前用户对应的
List<WeFlowerCustomerRel> flowerCustomerRels = iWeFlowerCustomerRelService.list(new LambdaQueryWrapper<WeFlowerCustomerRel>()
.eq(WeFlowerCustomerRel::getExternalUserid, weMakeCustomerTag.getExternalUserid()));
if(CollectionUtil.isNotEmpty(flowerCustomerRels) ){
if(iWeFlowerCustomerTagRelService.remove(
new LambdaQueryWrapper<WeFlowerCustomerTagRel>()
.in(WeFlowerCustomerTagRel::getFlowerCustomerRelId, flowerCustomerRels.stream().map(WeFlowerCustomerRel::getId).collect(Collectors.toList()))
.in(WeFlowerCustomerTagRel::getTagId, addTags.stream().map(WeTag::getTagId).collect(Collectors.toList()))
.in(WeFlowerCustomerTagRel::getTagId, removeTag.stream().map(WeFlowerCustomerTagRel::getTagId).collect(Collectors.toList()))
)){
flowerCustomerRels.stream().forEach(k->{
......@@ -409,7 +428,7 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper,WeCustom
CutomerTagEdit.builder()
.external_userid(k.getExternalUserid())
.userid(k.getUserId())
.remove_tag(ArrayUtil.toArray(addTags.stream().map(WeTag::getTagId).collect(Collectors.toList()), String.class))
.remove_tag(ArrayUtil.toArray(removeTag.stream().map(WeFlowerCustomerTagRel::getTagId).collect(Collectors.toList()), String.class))
.build()
);
......
......@@ -86,23 +86,20 @@ public class WeDepartmentServiceImpl extends ServiceImpl<WeDepartmentMapper,WeDe
* @return 结果
*/
@Override
@Transactional
public int insertWeDepartment(WeDepartment weDepartment)
public void insertWeDepartment(WeDepartment weDepartment)
{
weDepartment.setId(SnowFlakeUtil.nextId());
int returnCode=weDepartmentMapper.insertWeDepartment(weDepartment);
if(returnCode>0){
WeResultDto weDepartMent = weDepartMentClient.createWeDepartMent(
weDepartment.transformDeartMentDto(weDepartment)
);
weDepartMentClient.createWeDepartMent(
weDepartment.transformDeartMentDto(weDepartment)
);
if(weDepartMent.getErrcode().equals(WeConstans.WE_SUCCESS_CODE) && weDepartMent.getId() != null){
weDepartment.setId(weDepartMent.getId());
}
this.save(weDepartment);
}
return returnCode;
}
/**
......@@ -112,20 +109,29 @@ public class WeDepartmentServiceImpl extends ServiceImpl<WeDepartmentMapper,WeDe
* @return 结果
*/
@Override
public int updateWeDepartment(WeDepartment weDepartment)
public void updateWeDepartment(WeDepartment weDepartment)
{
int returnCode=weDepartmentMapper.updateWeDepartment(weDepartment);
if(returnCode>0){
weDepartMentClient.updateWeDepartMent(
weDepartment.transformDeartMentDto(weDepartment)
);
WeResultDto weDepartMent = weDepartMentClient.updateWeDepartMent(
weDepartment.transformDeartMentDto(weDepartment)
);
if(weDepartMent.getErrcode().equals(WeConstans.WE_SUCCESS_CODE)){
this.updateById(weDepartment);
}
return returnCode;
// int returnCode=weDepartmentMapper.updateWeDepartment(weDepartment);
// if(returnCode>0){
//
// weDepartMentClient.updateWeDepartMent(
// weDepartment.transformDeartMentDto(weDepartment)
// );
//
//
// }
//
// return returnCode;
}
......@@ -159,8 +165,7 @@ public class WeDepartmentServiceImpl extends ServiceImpl<WeDepartmentMapper,WeDe
public List<WeDepartment> synchWeDepartment() {
List<WeDepartment> weDepartments = weDepartMentClient.weAllDepartMents().findWeDepartments();
if(CollectionUtil.isNotEmpty(weDepartments)){
this.deleteAllWeDepartment();
this.batchInsertWeDepartment(weDepartments);
this.saveOrUpdateBatch(weDepartments);
}
return weDepartments;
......
......@@ -136,7 +136,7 @@ public class WeGroupServiceImpl extends ServiceImpl<WeGroupMapper,WeGroup> imple
.groupName(kk.getName())
.notice(kk.getNotice())
.owner(kk.getOwner())
.createTime(kk.getCreate_time())
.createTime(new Date(kk.getCreate_time() * 1000L))
.status(k.getStatus())
.build()
);
......@@ -148,7 +148,7 @@ public class WeGroupServiceImpl extends ServiceImpl<WeGroupMapper,WeGroup> imple
WeGroupMember.builder()
.chatId(kk.getChat_id())
.userId(member.getUserid())
.joinTime(member.getJoin_time())
.joinTime(new Date(member.getJoin_time() * 1000L))
.joinScene(member.getJoin_scene())
.joinType(member.getType())
.unionId(member.getUnionid())
......
......@@ -26,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="addWay" column="add_way" />
<result property="state" column="state" />
<result property="userName" column="user_name"/>
<result property="department" column="department"/>
<collection property="weFlowerCustomerTagRels" ofType="com.linkwechat.wecom.domain.WeFlowerCustomerTagRel">
<result property="flowerCustomerRelId" column="flower_customer_rel_id" />
<result property="tagId" column="tag_id" />
......@@ -64,7 +65,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
wfcrf.flower_customer_rel_id,
wt.tag_id,
wt.create_time,
wt.`name` as tagName
wt.`name` as tagName,
(SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department
FROM
we_customer wc
LEFT JOIN we_flower_customer_rel wfcr ON wc.external_userid=wfcr.external_userid
......
......@@ -4,75 +4,31 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.linkwechat.wecom.mapper.WeGroupMemberMapper">
<!-- <resultMap type="WeGroupMember" id="WeGroupMemberResult">-->
<!-- <result property="id" column="id" />-->
<!-- <result property="groupId" column="group_id" />-->
<!-- <result property="memberName" column="member_name" />-->
<!-- <result property="joinTime" column="join_time" />-->
<!-- <result property="joinType" column="join_type" />-->
<!-- </resultMap>-->
<!-- <sql id="selectWeGroupMemberVo">-->
<!-- select id, group_id, member_name, join_time, join_type from we_group_member-->
<!-- </sql>-->
<select id="selectWeGroupMemberList" parameterType="WeGroupMember" resultType="com.linkwechat.wecom.domain.WeGroupMember">
SELECT
wc.`name` AS memberName,
wgm.join_time,
wgm.type
wgm.type,
wgm.join_scene,
CASE
WHEN wgm.type=1 THEN
(
SELECT wu.user_name FROM we_user wu
WHERE wu.user_id=wgm.user_id
)
WHEN wgm.type = 2 THEN
(
SELECT wc.name FROM we_customer wc
WHERE wc.external_userid=wgm.user_id
)
END memberName
FROM
we_group_member wgm
LEFT JOIN we_customer wc ON wgm.user_id=wc.external_userid
<where>
<if test="chatId != null "> and wgm.chat_id = #{chatId}</if>
<if test="memberName != null and memberName != ''"> and wc.`name` like concat('%', #{memberName}, '%')</if>
<if test="memberName != null and memberName != ''"> and HAVING wc.`name` like concat('%', #{memberName}, '%')</if>
</where>
</select>
<!-- <select id="selectWeGroupMemberById" parameterType="Long" resultMap="WeGroupMemberResult">-->
<!-- <include refid="selectWeGroupMemberVo"/>-->
<!-- where id = #{id}-->
<!-- </select>-->
<!-- <insert id="insertWeGroupMember" parameterType="WeGroupMember">-->
<!-- insert into we_group_member-->
<!-- <trim prefix="(" suffix=")" suffixOverrides=",">-->
<!-- <if test="id != null">id,</if>-->
<!-- <if test="groupId != null">group_id,</if>-->
<!-- <if test="memberName != null">member_name,</if>-->
<!-- <if test="joinTime != null">join_time,</if>-->
<!-- <if test="joinType != null">join_type,</if>-->
<!-- </trim>-->
<!-- <trim prefix="values (" suffix=")" suffixOverrides=",">-->
<!-- <if test="id != null">#{id},</if>-->
<!-- <if test="groupId != null">#{groupId},</if>-->
<!-- <if test="memberName != null">#{memberName},</if>-->
<!-- <if test="joinTime != null">#{joinTime},</if>-->
<!-- <if test="joinType != null">#{joinType},</if>-->
<!-- </trim>-->
<!-- </insert>-->
<!-- <update id="updateWeGroupMember" parameterType="WeGroupMember">-->
<!-- update we_group_member-->
<!-- <trim prefix="SET" suffixOverrides=",">-->
<!-- <if test="groupId != null">group_id = #{groupId},</if>-->
<!-- <if test="memberName != null">member_name = #{memberName},</if>-->
<!-- <if test="joinTime != null">join_time = #{joinTime},</if>-->
<!-- <if test="joinType != null">join_type = #{joinType},</if>-->
<!-- </trim>-->
<!-- where id = #{id}-->
<!-- </update>-->
<!-- <delete id="deleteWeGroupMemberById" parameterType="Long">-->
<!-- delete from we_group_member where id = #{id}-->
<!-- </delete>-->
<!-- <delete id="deleteWeGroupMemberByIds" parameterType="String">-->
<!-- delete from we_group_member where id in-->
<!-- <foreach item="id" collection="array" open="(" separator="," close=")">-->
<!-- #{id}-->
<!-- </foreach>-->
<!-- </delete>-->
</mapper>
\ No newline at end of file
......@@ -28,12 +28,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectWeUserVo">
select head_image_url as avatarMediaid, user_name, alias, user_id, gender, mobile, email, wx_account, department, position, is_leader_in_dept, join_time, enable, id_card, qq_account, telephone, address, birthday, remark from we_user
select is_activate,head_image_url as avatarMediaid, user_name, alias, user_id, gender, mobile, email, wx_account, department, position, is_leader_in_dept, join_time, enable, id_card, qq_account, telephone, address, birthday, remark from we_user
</sql>
<select id="selectWeUserList" parameterType="WeUser" resultMap="WeUserResult">
<include refid="selectWeUserVo"/>
<where>
WHERE
is_activate !=6
<if test="avatarMediaid != null and avatarMediaid != ''"> and head_image_url = #{avatarMediaid}</if>
<if test="name != null and name != ''"> and user_name like concat('%', #{name}, '%')</if>
<if test="alias != null and alias != ''"> and alias = #{alias}</if>
......@@ -42,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="mobile != null and mobile != ''"> and mobile = #{mobile}</if>
<if test="email != null and email != ''"> and email = #{email}</if>
<if test="wxAccount != null and wxAccount != ''"> and wx_account = #{wxAccount}</if>
<if test="department != null and department != ''"> and FIND_IN_SET(#{department},department)</if>
<if test="department != null and department != '' and department != '1' "> and FIND_IN_SET(#{department},department)</if>
<if test="position != null and position != ''"> and position = #{position}</if>
<if test="isLeaderInDept != null "> and is_leader_in_dept = #{isLeaderInDept}</if>
<if test="joinTime != null "> and join_time = #{joinTime}</if>
......@@ -51,7 +52,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="telephone != null and telephone != ''"> and telephone = #{telephone}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="birthday != null "> and birthday = #{birthday}</if>
</where>
</select>
<select id="selectWeUserById" parameterType="Long" resultMap="WeUserResult">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册