123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351 |
- <template>
- <a-spin :spinning="spinning" tip="正在同步中...">
- <a-card :bordered="false">
-
- <div class="table-page-search-wrapper">
- <a-form layout="inline" @keyup.enter.native="searchQuery">
- <a-row :gutter="24">
- <a-col :md="6" :sm="12">
- <a-form-item label="数据模块">
-
- <j-input placeholder="输入数据模块查询" ></j-input>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-item label="同步方式">
- <j-input placeholder="输入同步方式查询" ></j-input>
- </a-form-item>
- </a-col>
-
- <a-col :md="6" :sm="8">
- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
- <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
- </span>
- </a-col>
- </a-row>
- </a-form>
- </div>
-
- <div class="table-operator" style="border-top: 5px">
- <a-button @click="pulldata()" type="primary" icon="plus" >拉取</a-button>
- <a-button @click="pulldata()" type="primary" icon="plus" >同步U8</a-button>
- <a-button @click="synchronizationWeixin()" type="primary" icon="plus" >同步企业微信</a-button>
- <a-dropdown :visible="show">
- <a-button @click="synchronizationPt()" type="primary" icon="plus" >同步中间平台</a-button>
- <a-menu slot="overlay">
- <a-menu-item >
- <a-month-picker placeholder="请选择日期" v-model="date"/>
- </a-menu-item>
-
- </a-menu>
- </a-dropdown>
-
- </div>
-
- <div>
- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
- <i class="anticon anticon-info-circle ant-alert-icon"></i>已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
- <a style="margin-left: 24px" @click="onClearSelected">清空</a>
- </div>
- <a-table
- ref="table"
- bordered
- size="middle"
- rowKey="id"
- :columns="columns"
- :dataSource="data"
- :pagination="ipagination"
- :loading="loading"
- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type: 'radio'}"
- @change="handleTableChange">
- <template slot="avatarslot" slot-scope="text, record, index">
- <div class="anty-img-wrap">
- <a-avatar shape="square" :src="getAvatarView(record.avatar)" icon="user"/>
- </div>
- </template>
- <span slot="action" slot-scope="text, record">
-
-
- </span>
- </a-table>
-
-
-
-
- </div>
-
-
-
-
- <user-recycle-bin-modal :visible.sync="recycleBinVisible" />
- </a-card>
- </a-spin>
- </template>
- <script>
- import UserModal from './modules/UserModal'
- import PasswordModal from './modules/PasswordModal'
- import {putAction,getFileAccessHttpUrl} from '@/api/manage';
- import {frozenBatch} from '@/api/api'
- import {pullData,synchronizationWeixin,tbquery,synchronizationPt} from '@/api/api'
- import {JeecgListMixin} from '@/mixins/JeecgListMixin'
- import JInput from '@/components/jeecg/JInput'
- import UserRecycleBinModal from './modules/UserRecycleBinModal'
- import JSuperQuery from '@/components/jeecg/JSuperQuery'
- export default {
- name: "UserList",
- mixins: [JeecgListMixin],
- components: {
- UserModal,
- PasswordModal,
- JInput,
- UserRecycleBinModal,
-
- JSuperQuery
- },
- data() {
- return {
- show:false,
- date:null,
- spinning:false,
- data:[],
- description: '这是数据同步管理页面',
- queryParam: {},
- recycleBinVisible: false,
- selectedRowKeys:[],
- columns: [
- {
- title: '编号',
- dataIndex: '',
- key:'rowIndex',
- width:60,
- align:"center",
- customRender:function (t,r,index) {
- return parseInt(index)+1;
- }
- },
- {
- title: '数据模块',
- align: "center",
- dataIndex: 'name',
- width: 120,
- sorter: true
- },
- {
- title: '状态',
- align: "center",
- width: 100,
- dataIndex: 'state',
- customRender:function (t,r,index) {
- if(r.state==""||r.state==null){
- return "暂无";
- }
- if(r.state=="0"){
- return "成功";
- }
- if(r.state=="1"){
- return "失败";
- }
- }
- },
- {
- title: '同步方式',
- align: "center",
- width: 120,
- dataIndex: 'type',
- customRender:function (t,r,index) {
-
- if(r.type==""||r.type==null){
- return "暂无";
- }
- if(r.type=="0"){
- return "手动同步";
- }
- if(r.type=="1"){
- return "自动同步";
- }
- }
- },
- {
- title: '同步时间',
- align: "center",
- width: 120,
- dataIndex: 'date',
- sorter: true,
- customRender:function (t,r,index) {
-
- if(r.date==""||r.date==null){
- return "暂无";
- }else{
- return r.date;
- }
-
- }
- },
- {
- title: '用时',
- align: "center",
- width: 100,
- dataIndex: 'time',
- customRender:function (t,r,index) {
-
- if(r.time==""||r.time==null){
- return "暂无";
- }else{
- return r.time+"秒";
- }
-
- }
- },
-
- {
- title: '操作',
- align: "center",
- width: 150,
- }
- ],
-
- }
- },
-
- created() {
- this.querylist();
- },
- methods: {
- querylist:function(){
- tbquery({}).then(res=>{
- this.data=res;
- })
-
- },
- synchronizationPt:function(){
- if(this.selectedRowKeys.length<1){
- this.$message.warning('请选择需要同步的数据!');
- return false;
- }
- if(this.selectedRowKeys[0]==1){
- this.$message.warning('该数据不能同步到平台!');
- return false;
- }
- this.show=true;
- if(this.date==null){
- this.$message.warning('请选择需要同步的日期!');
- return false;
- }
-
- this.spinning=true;
- var datetime=this.formats(this.date);
- synchronizationPt({date:datetime,id:this.selectedRowKeys[0],type:0,typeGo:2}).then(res=>{
- console.log(res);
- this.$message.warning('同步成功'+res.count+'条,同步失败'+res.errCount+'条');
- this.querylist();
- this.spinning=false;
- })
-
-
- },
- formats:function(e){
- var date = new Date(e);
- var seperator1 = "-";
- var year = date.getFullYear();
- var month = date.getMonth() + 1;
- if (month >= 1 && month <= 9) {
- month = "0" + month;
- }
-
- var currentdate = year + seperator1 + month;
- return currentdate;
- },
- onSelectChange(selectedRowKeys) {
- this.selectedRowKeys=selectedRowKeys;
- },
- synchronizationWeixin:function(){
- if(this.selectedRowKeys.length<1){
- this.$message.warning('请选择需要同步的数据!');
- return false;
- }
- if(this.selectedRowKeys[0]!=1){
- this.$message.warning('该数据不能同步到企业微信!');
- return false;
- }
- this.spinning=true;
- synchronizationWeixin({id:this.selectedRowKeys[0],type:0,typeGo:0}).then(res=>{
- this.$message.warning(res.msg);
- this.querylist();
- this.spinning=false;
- })
- },
- pulldata:function(){
- this.spinning=true;
- pullData({}).then(res=>{
- if(res.errCode=="0"){
- this.$message.success('拉取数据成功'
- +res.userCount+"条,拉取数据失败"+res.userErrCount+"条");
-
- }else{
- this.$message.warning("拉取数据失败");
- }
- this.spinning=false;
-
- })
- },
-
-
- }
- }
- </script>
- <style scoped>
- @import '~@assets/less/common.less'
- </style>
|