Browse Source

设计绩效页面

zhuxinbo 5 years ago
parent
commit
eae2fc0730
3 changed files with 197 additions and 208 deletions
  1. 49 143
      src/views/ureport/UReportFileBindUserList.vue
  2. 146 63
      src/views/ureport/UReportFileList.vue
  3. 2 2
      vue.config.js

+ 49 - 143
src/views/ureport/UReportFileBindUserList.vue

@@ -1,70 +1,7 @@
 <template>
   <a-card :bordered="false">
-
-    <!-- 查询区域 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline">
-        <a-row :gutter="24">
-
-          <a-col :md="6" :sm="8">
-            <a-form-item label="fileId">
-              <a-input placeholder="请输入fileId" v-model="queryParam.fileId"></a-input>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="8">
-            <a-form-item label="userId">
-              <a-input placeholder="请输入userId" v-model="queryParam.userId"></a-input>
-            </a-form-item>
-          </a-col>
-        <template v-if="toggleSearchStatus">
-        <a-col :md="6" :sm="8">
-            <a-form-item label="userName">
-              <a-input placeholder="请输入userName" v-model="queryParam.userName"></a-input>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="8">
-            <a-form-item label="fileName">
-              <a-input placeholder="请输入fileName" v-model="queryParam.fileName"></a-input>
-            </a-form-item>
-          </a-col>
-          </template>
-          <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>
-              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
-              <a @click="handleToggleSearch" style="margin-left: 8px">
-                {{ toggleSearchStatus ? '收起' : '展开' }}
-                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
-              </a>
-            </span>
-          </a-col>
-
-        </a-row>
-      </a-form>
-    </div>
-
-    <!-- 操作按钮区域 -->
-    <div class="table-operator">
-      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
-      <a-button type="primary" icon="download" @click="handleExportXls('用户绑定报表信息')">导出</a-button>
-      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
-        <a-button type="primary" icon="import">导入</a-button>
-      </a-upload>
-      <a-dropdown v-if="selectedRowKeys.length > 0">
-        <a-menu slot="overlay">
-          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
-        </a-menu>
-        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
-      </a-dropdown>
-    </div>
-
     <!-- table区域-begin -->
     <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"
         size="middle"
@@ -74,25 +11,11 @@
         :dataSource="dataSource"
         :pagination="ipagination"
         :loading="loading"
-        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
-        @change="handleTableChange">
-
+        @change="handleTableChange"
+      >
         <span slot="action" slot-scope="text, record">
-          <a @click="handleEdit(record)">编辑</a>
-
-          <a-divider type="vertical" />
-          <a-dropdown>
-            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
-            <a-menu slot="overlay">
-              <a-menu-item>
-                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
-                  <a>删除</a>
-                </a-popconfirm>
-              </a-menu-item>
-            </a-menu>
-          </a-dropdown>
+          <a @click="lookView(record)">预览</a>
         </span>
-
       </a-table>
     </div>
     <!-- table区域-end -->
@@ -103,76 +26,59 @@
 </template>
 
 <script>
-  import UReportFileBindUserModal from './modules/UReportFileBindUserModal'
-  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import UReportFileBindUserModal from './modules/UReportFileBindUserModal'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 
-  export default {
-    name: "UReportFileBindUserList",
-    mixins:[JeecgListMixin],
-    components: {
-      UReportFileBindUserModal
-    },
-    data () {
-      return {
-        description: '用户绑定报表信息管理页面',
-        // 表头
-        columns: [
-          {
-            title: '#',
-            dataIndex: '',
-            key:'rowIndex',
-            width:60,
-            align:"center",
-            customRender:function (t,r,index) {
-              return parseInt(index)+1;
-            }
-           },
-		   {
-            title: 'fileId',
-            align:"center",
-            dataIndex: 'fileId'
-           },
-		   {
-            title: 'userId',
-            align:"center",
-            dataIndex: 'userId'
-           },
-		   {
-            title: 'userName',
-            align:"center",
-            dataIndex: 'userName'
-           },
-		   {
-            title: 'fileName',
-            align:"center",
-            dataIndex: 'fileName'
-           },
-          {
-            title: '操作',
-            dataIndex: 'action',
-            align:"center",
-            scopedSlots: { customRender: 'action' },
-          }
-        ],
-		url: {
-          list: "/ctop/uReportFileBindUser/list",
-          delete: "/ctop/uReportFileBindUser/delete",
-          deleteBatch: "/ctop/uReportFileBindUser/deleteBatch",
-          exportXlsUrl: "ctop/uReportFileBindUser/exportXls",
-          importExcelUrl: "ctop/uReportFileBindUser/importExcel",
-       },
+export default {
+  name: 'UReportFileBindUserList',
+  mixins: [JeecgListMixin],
+  components: {
+    UReportFileBindUserModal
+  },
+  data() {
+    return {
+      description: '用户绑定报表信息管理页面',
+      // 表头
+      columns: [
+        {
+          title: '报表模板名称',
+          align: 'center',
+          dataIndex: 'fileName'
+        },
+        {
+          title: '操作',
+          dataIndex: 'action',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      url: {
+        list: '/ctop/uReportFileBindUser/list',
+        delete: '/ctop/uReportFileBindUser/delete',
+        deleteBatch: '/ctop/uReportFileBindUser/deleteBatch',
+        exportXlsUrl: 'ctop/uReportFileBindUser/exportXls',
+        importExcelUrl: 'ctop/uReportFileBindUser/importExcel'
+      }
     }
   },
   computed: {
-    importExcelUrl: function(){
-      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+    importExcelUrl: function() {
+      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
     }
   },
-    methods: {
-     
+  methods: {
+    lookView(item) {
+      var url = ''
+      if (process.env.NODE_ENV === 'development') {
+        url = 'http://39.106.184.70:8080/jeecg-boot/ureport/preview?_u=mysql:' + item.fileName
+      } else if (process.env.NODE_ENV === 'production') {
+        url = 'http://39.97.120.42:8080/jeecg-boot/ureport/preview?_u=mysql:' + item.fileName
+      }
+      window.open(url, '_blank')
     }
   }
+}
 </script>
 <style scoped>
-  @import '~@assets/less/common.less'
-</style>
+@import '~@assets/less/common.less';
+</style>

+ 146 - 63
src/views/ureport/UReportFileList.vue

@@ -1,30 +1,26 @@
 <template>
   <a-card :bordered="false">
-
     <!-- 查询区域 -->
     <div class="table-page-search-wrapper">
       <a-form layout="inline">
         <a-row :gutter="24">
-
           <a-col :md="6" :sm="8">
             <a-form-item label="报表名称">
               <a-input placeholder="请输入报表名称" v-model="queryParam.name"></a-input>
             </a-form-item>
           </a-col>
-          <a-col :md="6" :sm="8" >
+          <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>
               <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
             </span>
           </a-col>
-
         </a-row>
       </a-form>
     </div>
 
     <!-- table区域-begin -->
     <div>
-
       <a-table
         ref="table"
         size="middle"
@@ -34,84 +30,171 @@
         :dataSource="dataSource"
         :pagination="ipagination"
         :loading="loading"
-        @change="handleTableChange">
-
+        @change="handleTableChange"
+      >
         <span slot="action" slot-scope="text, record">
-          <a @click="handleEdit(record)">编辑</a>
+          <a @click="addParams(record)">绑定</a>
 
           <a-divider type="vertical" />
-          <a-dropdown>
-            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
-            <a-menu slot="overlay">
-              <a-menu-item>
-                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
-                  <a>删除</a>
-                </a-popconfirm>
-              </a-menu-item>
-            </a-menu>
-          </a-dropdown>
+          <a @click="deleteParams(record)">解绑</a>
         </span>
-
       </a-table>
     </div>
     <!-- table区域-end -->
 
     <!-- 表单区域 -->
     <uReportFile-modal ref="modalForm" @ok="modalFormOk"></uReportFile-modal>
+
+    <!--  查看成员,接触绑定 -->
+    <a-modal title="解除绑定" v-model="visible" @ok="handleOk" width="800px" class="close-account-my-project">
+      <div style="display:flex;line-height:50px;flex-wrap: wrap;">
+        <div style="width:25%;text-align:center;" v-for="(item, index) of memberList" :key="index">
+          <a-tag color="#2db7f5" @close="log(item.userId)" closable>{{ item.userName }}</a-tag>
+        </div>
+      </div>
+    </a-modal>
+
+    <!--  添加项目成员 -->
+    <a-modal title="绑定用户" v-model="visibleAdd" @ok="handleOkAdd" :confirmLoading="confirmLoading">
+      <!-- /sys/user/getAllUserList -->
+      <a-select
+        v-model="appId"
+        showSearch
+        allowClear
+        mode="multiple"
+        placeholder="请选择成员"
+        optionFilterProp="children"
+        style="width: 100%"
+        :filterOption="filterOption"
+        :maxTagCount="1"
+      >
+        <a-select-option
+          v-for="appModel in options"
+          :key="appModel.userId + new Date().getTime()"
+          :value="appModel.userId"
+        >
+          {{ appModel.realName }}
+          &#12288;&#12288;{{ appModel.roleName }}</a-select-option
+        >
+      </a-select>
+    </a-modal>
   </a-card>
 </template>
 
 <script>
-  import UReportFileModal from './modules/UReportFileModal'
-  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-
-  export default {
-    name: "UReportFileList",
-    mixins:[JeecgListMixin],
-    components: {
-      UReportFileModal
-    },
-    data () {
-      return {
-        description: '报表文件存储管理页面',
-        // 表头
-        columns: [
-		   {
-            title: '报表名称',
-            align:"center",
-            dataIndex: 'name'
-           },
-          {
-            title: '所属用户',
-            align:"center",
-            dataIndex: 'userId_dictText'
-          },
-          {
-            title: '操作',
-            dataIndex: 'action',
-            align:"center",
-            scopedSlots: { customRender: 'action' },
-          }
-        ],
-		url: {
-          list: "/ctop/uReportFile/list",
-          delete: "/ctop/uReportFile/delete",
-          deleteBatch: "/ctop/uReportFile/deleteBatch",
-          exportXlsUrl: "ctop/uReportFile/exportXls",
-          importExcelUrl: "ctop/uReportFile/importExcel",
-       },
+import UReportFileModal from './modules/UReportFileModal'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { httpAction, getAction, deleteAction } from '@/api/manage'
+export default {
+  name: 'UReportFileList',
+  mixins: [JeecgListMixin],
+  components: {
+    UReportFileModal
+  },
+  data() {
+    return {
+      description: '报表文件存储管理页面',
+      // 表头
+      columns: [
+        {
+          title: '报表名称',
+          align: 'center',
+          dataIndex: 'name'
+        },
+        {
+          title: '所属用户',
+          align: 'center',
+          dataIndex: 'userId_dictText'
+        },
+        {
+          title: '操作',
+          dataIndex: 'action',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      url: {
+        list: '/ctop/uReportFile/list',
+        delete: '/ctop/uReportFile/delete',
+        deleteBatch: '/ctop/uReportFile/deleteBatch',
+        exportXlsUrl: 'ctop/uReportFile/exportXls',
+        importExcelUrl: 'ctop/uReportFile/importExcel'
+      },
+      visibleAdd: false,
+      itemJson: null,
+      list: [],
+      options: [],
+      confirmLoading: false,
+      appId: [],
+      memberList: [],
+      visible: false,
+      fileId: ''
     }
   },
   computed: {
-    importExcelUrl: function(){
-      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+    importExcelUrl: function() {
+      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
     }
   },
-    methods: {
-
+  methods: {
+    filterOption(input, option) {
+      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+    },
+    addParams(item) {
+      this.visibleAdd = true
+      this.itemJson = item
+      getAction('/sys/user/getAllUserList', '').then(res => {
+        if (res.success) {
+          this.list = res.result
+          this.options = res.result
+        }
+      })
+    },
+    log(id) {
+      httpAction('/ctop/uReportFile/unbindUser', { fileId: this.fileId, userId: id }, 'post').then(res => {
+        if (res.success) {
+          this.getMemberList(this.fileId)
+          this.$message.success('删除成功')
+        } else {
+          this.$message.error(res.message)
+        }
+      })
+    },
+    handleOk(e) {
+      this.visible = false
+    },
+    handleOkAdd(e) {
+      var params = {}
+      params.fileId = this.itemJson.id
+      params.userIds = this.appId.join()
+      this.confirmLoading = true
+      httpAction('/ctop/uReportFile/bindUser', params, 'post').then(res => {
+        this.confirmLoading = false
+        if (res.success) {
+          this.visibleAdd = false
+          this.appId = []
+          this.$message.success('添加成功')
+        } else {
+          this.$message.error('添加失败')
+        }
+      })
+    },
+    deleteParams(item) {
+      this.fileId = item.id
+      this.getMemberList(item.id)
+    },
+    getMemberList(id) {
+      this.memberList = []
+      httpAction('/ctop/uReportFileBindUser/userList', { fileId: id }, 'post').then(res => {
+        if (res.success) {
+          this.visible = true
+          this.memberList = res.data
+        }
+      })
     }
   }
+}
 </script>
 <style scoped>
-  @import '~@assets/less/common.less'
-</style>
+@import '~@assets/less/common.less';
+</style>

+ 2 - 2
vue.config.js

@@ -67,10 +67,10 @@ module.exports = {
         // target: 'http://39.97.120.42:8080', //请求本地 需要jeecg-boot后台项目  生产环境
         // target: 'http://39.106.184.70:8080', //请求本地 需要jeecg-boot后台项目
         // target: 'http://192.168.2.143:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
-        // target: 'http://192.168.2.118:8080', //请求本地 需要jeecg-boot后台项目  英豪
+        target: 'http://192.168.2.118:8080', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.2.132:8080', //请求本地 需要jeecg-boot后台项目
         // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目  祚云
-        target: 'http://192.168.2.132:8080', //请求本地 需要jeecg-boot后台项目  孙震
+        // target: 'http://192.168.2.132:8080', //请求本地 需要jeecg-boot后台项目  孙震
 
         ws: false,
         changeOrigin: true