From 1c21609a31e43427b29816d43d230fcf2830cdc0 Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期三, 13 十一月 2024 16:42:33 +0800 Subject: [PATCH] 1、调整首页背景图 2、调整用户管理页面字段 --- /dev/null | 372 ------------- src/views/system/UserList.vue | 249 +++++++- src/views/system/modules/UserModal.vue | 875 +++++++++++++++++++++---------- src/assets/index.png | 0 src/views/dashboard/Analysis.vue | 24 src/views/system/modules/UserRecycleBinModal.vue | 45 + src/components/layouts/TabLayout.vue | 89 +- 7 files changed, 883 insertions(+), 771 deletions(-) diff --git a/src/assets/index.png b/src/assets/index.png new file mode 100644 index 0000000..440b756 --- /dev/null +++ b/src/assets/index.png Binary files differ diff --git a/src/components/layouts/TabLayout.vue b/src/components/layouts/TabLayout.vue index 8197cff..75d7803 100644 --- a/src/components/layouts/TabLayout.vue +++ b/src/components/layouts/TabLayout.vue @@ -14,11 +14,12 @@ @change="changePage" @tabClick="tabCallBack" @edit="editPage"> - <a-tab-pane :id="page.fullPath" :key="page.fullPath" v-for="page in pageList" :closable="!(page.meta.title=='棣栭〉')"> + <a-tab-pane :id="page.fullPath" :key="page.fullPath" v-for="page in pageList" + :closable="!(page.meta.title=='棣栭〉')"> <span slot="tab" :pagekey="page.fullPath">{{ page.meta.title }}</span> </a-tab-pane> </a-tabs> - <div style="margin: 12px 12px 0;"> + <div :style="{padding:$route.meta.title=='棣栭〉'?'0':'12px 12px 0'}"> <!-- update-begin-author:taoyan date:20201221 for:姝ゅ鍒犳帀transition鏍囩 涓嶇煡閬撲负浠�涔堝姞涓婂悗 椤甸潰璺敱鍒囨崲鐨勬椂鍊欏嵆1鍙婅彍鍗曞垏鍒�2鍙婅彍鍗曠殑鏃跺�� 涓や釜鑿滃崟椤甸潰浼氬悓鏃跺嚭鐜�300-500绉掑乏鍙� --> <keep-alive v-if="multipage"> <router-view v-if="reloadFlag"/> @@ -41,7 +42,7 @@ import { triggerWindowResizeEvent } from '@/utils/util' import Vue from 'vue' import { CACHE_INCLUDED_ROUTES } from '@/store/mutation-types' - import registerApps from "@/qiankun"; + import registerApps from '@/qiankun' const indexKey = '/dashboard/analysis' @@ -64,15 +65,15 @@ { key: '2', icon: 'arrow-right', text: '鍏抽棴鍙充晶' }, { key: '3', icon: 'close', text: '鍏抽棴鍏跺畠' } ], - reloadFlag:true + reloadFlag: true } }, /* update_begin author:wuxianquan date:20190828 for: 鍏抽棴褰撳墠tab椤碉紝渚涘瓙椤甸潰璋冪敤 ->鏈涜彍鍗曡兘閰嶇疆澶栭摼锛岀洿鎺ュ脊鍑烘柊椤甸潰鑰屼笉鏄祵鍏frame #428 */ - provide(){ - return{ - closeCurrent:this.closeCurrent, + provide() { + return { + closeCurrent: this.closeCurrent, changeTitle: this.changeTitle, - changeTabTitle: this.changeTabTitle, + changeTabTitle: this.changeTabTitle } }, /* update_end author:wuxianquan date:20190828 for: 鍏抽棴褰撳墠tab椤碉紝渚涘瓙椤甸潰璋冪敤->鏈涜彍鍗曡兘閰嶇疆澶栭摼锛岀洿鎺ュ脊鍑烘柊椤甸潰鑰屼笉鏄祵鍏frame #428 */ @@ -101,8 +102,8 @@ if (process.env.VUE_APP_QIANKUN == 'true') { //update-begin-author:zyf date:20211129 for:qiankun 娉ㄥ唽瀛愬簲鐢� if (!window.qiankunStarted) { - window.qiankunStarted = true; - registerApps(); + window.qiankunStarted = true + registerApps() } //update-end-author:zyf date:20211129 for:qiankun 娉ㄥ唽瀛愬簲鐢� } @@ -113,17 +114,17 @@ this.activePage = newRoute.fullPath if (!this.multipage) { this.linkList = [newRoute.fullPath] - this.pageList = [Object.assign({},newRoute)] - // update-begin-author:taoyan date:20200211 for: TASK #3368 銆愯矾鐢辩紦瀛樸�戦椤电殑缂撳瓨璁剧疆鏈夐棶棰橈紝闇�瑕佹牴鎹悗鍙扮殑璺敱閰嶇疆鏉ュ疄鐜版槸鍚︾紦瀛� - } else if(indexKey==newRoute.fullPath) { + this.pageList = [Object.assign({}, newRoute)] + // update-begin-author:taoyan date:20200211 for: TASK #3368 銆愯矾鐢辩紦瀛樸�戦椤电殑缂撳瓨璁剧疆鏈夐棶棰橈紝闇�瑕佹牴鎹悗鍙扮殑璺敱閰嶇疆鏉ュ疄鐜版槸鍚︾紦瀛� + } else if (indexKey == newRoute.fullPath) { //棣栭〉鏃� 鍒ゆ柇鏄惁缂撳瓨 娌℃湁缂撳瓨 鍒锋柊涔� if (newRoute.meta.keepAlive === false) { this.routeReload() } - // update-end-author:taoyan date:20200211 for: TASK #3368 銆愯矾鐢辩紦瀛樸�戦椤电殑缂撳瓨璁剧疆鏈夐棶棰橈紝闇�瑕佹牴鎹悗鍙扮殑璺敱閰嶇疆鏉ュ疄鐜版槸鍚︾紦瀛� - }else if (this.linkList.indexOf(newRoute.fullPath) < 0) { + // update-end-author:taoyan date:20200211 for: TASK #3368 銆愯矾鐢辩紦瀛樸�戦椤电殑缂撳瓨璁剧疆鏈夐棶棰橈紝闇�瑕佹牴鎹悗鍙扮殑璺敱閰嶇疆鏉ュ疄鐜版槸鍚︾紦瀛� + } else if (this.linkList.indexOf(newRoute.fullPath) < 0) { this.linkList.push(newRoute.fullPath) - this.pageList.push(Object.assign({},newRoute)) + this.pageList.push(Object.assign({}, newRoute)) //// update-begin-author:sunjianlei date:20200103 for: 濡傛灉鏂板鐨勯〉闈㈤厤缃簡缂撳瓨璺敱锛岄偅涔堝氨寮哄埗鍒锋柊涓�閬� #842 // if (newRoute.meta.keepAlive) { // this.routeReload() @@ -132,7 +133,7 @@ } else if (this.linkList.indexOf(newRoute.fullPath) >= 0) { let oldIndex = this.linkList.indexOf(newRoute.fullPath) let oldPositionRoute = this.pageList[oldIndex] - this.pageList.splice(oldIndex, 1, Object.assign({},newRoute,{meta:oldPositionRoute.meta})) + this.pageList.splice(oldIndex, 1, Object.assign({}, newRoute, { meta: oldPositionRoute.meta })) } }, 'activePage': function(key) { @@ -145,7 +146,7 @@ this.changeTitle(waitRouter.meta.title) }, 'multipage': function(newVal) { - if(this.reloadFlag){ + if (this.reloadFlag) { if (!newVal) { this.linkList = [this.$route.fullPath] this.pageList = [this.$route] @@ -157,7 +158,7 @@ if (this.multipage && this.linkList.indexOf(indexKey) === -1) { this.addIndexToFirst() } - }, + } // update-end-author:sunjianlei date:20191223 for: 淇浠庡崟椤垫ā寮忓垏鎹㈠洖澶氶〉妯″紡鍚庨椤典笉灞呯涓�浣嶇殑 BUG }, methods: { @@ -183,7 +184,7 @@ * @param title 瑕佷慨鏀圭殑鏂版爣棰� */ changeTitle(title) { - let projectTitle = "涓浗鑸彂鎴愬彂" + let projectTitle = '涓浗鑸彂鎴愬彂' // 棣栭〉鐗规畩澶勭悊 if (this.$route.path === indexKey) { document.title = projectTitle @@ -200,7 +201,7 @@ if (title) { let currentRoute = this.pageList.find((r) => r.fullPath === (fullPath ? fullPath : this.$route.fullPath)) if (currentRoute != null) { - currentRoute.meta = {...currentRoute.meta, title} + currentRoute.meta = { ...currentRoute.meta, title } } } }, @@ -212,10 +213,10 @@ tabCallBack() { this.$nextTick(() => { //update-begin-author:taoyan date: 20201211 for:銆愭柊鐗堛�憃nline鎶ラ敊 JT-100 - setTimeout(()=>{ - //鐪佸競鍖虹粍浠堕噷闈㈢粰window缁戝畾浜嗕釜resize浜嬩欢 瀵艰嚧鍒囨崲椤甸潰鐨勬椂鍊欒Е鍙戜簡浠栫殑resize锛屼絾鏄垏鎹㈤〉闈紝鐪佸競鍖虹粍浠惰繕娌¤閿�姣佸墠灏辫Е鍙戜簡璇ヤ簨浠讹紝瀵艰嚧鎺у埗鍙版姤閿欙紝鍔犱釜寤惰繜 - triggerWindowResizeEvent() - },20) + setTimeout(() => { + //鐪佸競鍖虹粍浠堕噷闈㈢粰window缁戝畾浜嗕釜resize浜嬩欢 瀵艰嚧鍒囨崲椤甸潰鐨勬椂鍊欒Е鍙戜簡浠栫殑resize锛屼絾鏄垏鎹㈤〉闈紝鐪佸競鍖虹粍浠惰繕娌¤閿�姣佸墠灏辫Е鍙戜簡璇ヤ簨浠讹紝瀵艰嚧鎺у埗鍙版姤閿欙紝鍔犱釜寤惰繜 + triggerWindowResizeEvent() + }, 20) //update-end-author:taoyan date: 20201211 for:銆愭柊鐗堛�憃nline鎶ラ敊 JT-100 }) }, @@ -231,7 +232,7 @@ this.$message.warning('杩欐槸鏈�鍚庝竴椤碉紝涓嶈兘鍐嶅叧闂簡鍟�') return } - console.log("this.pageList ",this.pageList ); + console.log('this.pageList ', this.pageList) let removeRoute = this.pageList.filter(item => item.fullPath == key) this.pageList = this.pageList.filter(item => item.fullPath !== key) let index = this.linkList.indexOf(key) @@ -244,9 +245,9 @@ let cacheRouterArray = Vue.ls.get(CACHE_INCLUDED_ROUTES) || [] if (removeRoute && removeRoute[0]) { let componentName = removeRoute[0].meta.componentName - console.log("key: ", key); - console.log("componentName: ", componentName); - if(cacheRouterArray.includes(componentName)){ + console.log('key: ', key) + console.log('componentName: ', componentName) + if (cacheRouterArray.includes(componentName)) { cacheRouterArray.splice(cacheRouterArray.findIndex(item => item === componentName), 1) Vue.ls.set(CACHE_INCLUDED_ROUTES, cacheRouterArray) } @@ -300,13 +301,13 @@ } }, /* update_begin author:wuxianquan date:20190828 for: 鍏抽棴褰撳墠tab椤碉紝渚涘瓙椤甸潰璋冪敤->鏈涜彍鍗曡兘閰嶇疆澶栭摼锛岀洿鎺ュ脊鍑烘柊椤甸潰鑰屼笉鏄祵鍏frame #428 */ - closeCurrent(){ - this.remove(this.activePage); + closeCurrent() { + this.remove(this.activePage) }, /* update_end author:wuxianquan date:20190828 for: 鍏抽棴褰撳墠tab椤碉紝渚涘瓙椤甸潰璋冪敤->鏈涜彍鍗曡兘閰嶇疆澶栭摼锛岀洿鎺ュ脊鍑烘柊椤甸潰鑰屼笉鏄祵鍏frame #428 */ closeOthers(pageKey) { let index = this.linkList.indexOf(pageKey) - if (pageKey == indexKey || pageKey.indexOf('?ticke=')>=0) { + if (pageKey == indexKey || pageKey.indexOf('?ticke=') >= 0) { this.linkList = this.linkList.slice(index, index + 1) this.pageList = this.pageList.slice(index, index + 1) this.activePage = this.linkList[0] @@ -343,12 +344,12 @@ } }, //update-begin-author:taoyan date:20190430 for:鍔ㄦ�佽矾鐢眛itle鏄剧ず閰嶇疆鐨勮彍鍗晅itle鑰屼笉鏄叾瀵瑰簲璺敱鐨則itle - dynamicRouterShow(key,title){ + dynamicRouterShow(key, title) { let keyIndex = this.linkList.indexOf(key) - if(keyIndex>=0){ + if (keyIndex >= 0) { let currRouter = this.pageList[keyIndex] - let meta = Object.assign({},currRouter.meta,{title:title}) - this.pageList.splice(keyIndex, 1, Object.assign({},currRouter,{meta:meta})) + let meta = Object.assign({}, currRouter.meta, { title: title }) + this.pageList.splice(keyIndex, 1, Object.assign({}, currRouter, { meta: meta })) if (key === this.activePage) { this.changeTitle(title) } @@ -357,20 +358,20 @@ //update-end-author:taoyan date:20190430 for:鍔ㄦ�佽矾鐢眛itle鏄剧ず閰嶇疆鐨勮彍鍗晅itle鑰屼笉鏄叾瀵瑰簲璺敱鐨則itle //update-begin-author:taoyan date:20191008 for:璺敱鍒锋柊 - routeReload(){ + routeReload() { this.reloadFlag = false - let ToggleMultipage = "ToggleMultipage" - this.$store.dispatch(ToggleMultipage,false) - this.$nextTick(()=>{ - this.$store.dispatch(ToggleMultipage,true) + let ToggleMultipage = 'ToggleMultipage' + this.$store.dispatch(ToggleMultipage, false) + this.$nextTick(() => { + this.$store.dispatch(ToggleMultipage, true) this.reloadFlag = true }) }, //update-end-author:taoyan date:20191008 for:璺敱鍒锋柊 //鏂板涓�涓繑鍥炴柟娉� - excuteCallback(callback){ + excuteCallback(callback) { callback() - }, + } } } </script> @@ -453,7 +454,7 @@ border-bottom: 1px solid transparent !important; } .ant-tabs-tab-active { - border-color: @primary-color!important; + border-color: @primary-color !important; } } diff --git a/src/views/dashboard/Analysis.vue b/src/views/dashboard/Analysis.vue index 2e16b22..fd44f2d 100644 --- a/src/views/dashboard/Analysis.vue +++ b/src/views/dashboard/Analysis.vue @@ -1,35 +1,17 @@ <template> <div> - <index-chart v-if="indexStyle==1"></index-chart> - <index-bdc v-if="indexStyle==2"></index-bdc> - <index-task v-if="indexStyle==3"></index-task> - <div style="width: 100%;text-align: right;margin-top: 20px"> - 璇烽�夋嫨棣栭〉鏍峰紡锛� - <a-radio-group v-model="indexStyle"> - <a-radio :value="1">缁熻鍥捐〃</a-radio> - <a-radio :value="2">缁熻鍥捐〃2</a-radio> - <a-radio :value="3">浠诲姟琛ㄦ牸</a-radio> - </a-radio-group> - </div> + <img src="@/assets/index.png" style="width: 100%;height: 785px"> </div> </template> <script> - import IndexChart from './IndexChart' - import IndexTask from "./IndexTask" - import IndexBdc from './IndexBdc' - export default { name: "Analysis", components: { - IndexChart, - IndexTask, - IndexBdc + }, data() { - return { - indexStyle:1 - } + }, created() { diff --git a/src/views/dashboard/IndexBdc.vue b/src/views/dashboard/IndexBdc.vue deleted file mode 100644 index fa8edea..0000000 --- a/src/views/dashboard/IndexBdc.vue +++ /dev/null @@ -1,519 +0,0 @@ -<template> - <div class="page-header-index-wide"> - <a-row :gutter="24"> - <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }"> - <chart-card :loading="loading" title="鍙楃悊閲�" :total="cardCount.sll | NumberFormat"> - <a-tooltip title="鎸囨爣璇存槑" slot="action"> - <a-icon type="info-circle-o" /> - </a-tooltip> - <div> - <mini-area :data-source="chartData.sll" /> - </div> - <template slot="footer">浠婃棩鍙楃悊閲忥細<span>{{ todaySll }}</span></template> - </chart-card> - </a-col> - <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }"> - <chart-card :loading="loading" title="鍔炵粨閲�" :total="cardCount.bjl | NumberFormat"> - <a-tooltip title="鎸囨爣璇存槑" slot="action"> - <a-icon type="info-circle-o" /> - </a-tooltip> - <div> - <mini-area :data-source="chartData.bjl"/> - </div> - <template slot="footer">浠婃棩鍔炵粨閲忥細<span>{{ todayBjl }}</span></template> - </chart-card> - </a-col> - <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }"> - <chart-card :loading="loading" title="鐢ㄦ埛鍙楃悊閲�" :total="cardCount.isll | NumberFormat"> - <a-tooltip title="鎸囨爣璇存槑" slot="action"> - <a-icon type="info-circle-o" /> - </a-tooltip> - <div> - <mini-bar :datasource="chartData.isll" :height="50"/> - </div> - <template slot="footer">鐢ㄦ埛浠婃棩鍙楃悊閲忥細<span>{{ todayISll }}</span></template> - </chart-card> - </a-col> - <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }"> - <chart-card :loading="loading" title="鐢ㄦ埛鍔炵粨閲�" :total="cardCount.ibjl | NumberFormat"> - <a-tooltip title="鎸囨爣璇存槑" slot="action"> - <a-icon type="info-circle-o" /> - </a-tooltip> - <div> - <mini-bar :datasource="chartData.ibjl" :height="50"/> - </div> - <template slot="footer">鐢ㄦ埛浠婃棩鍔炵粨閲忥細<span>{{ todayIBjl }}</span></template> - </chart-card> - </a-col> - </a-row> - - <a-card :loading="loading" :bordered="false" :body-style="{padding: '0'}"> - <div class="salesCard"> - <a-tabs default-active-key="1" size="large" :tab-bar-style="{marginBottom: '24px', paddingLeft: '16px'}"> - <div class="extra-wrapper" slot="tabBarExtraContent"> - <div class="extra-item"> - <a>浠婃棩</a> - <a>鏈懆</a> - <a>鏈湀</a> - <a>鏈勾</a> - </div> - <a-range-picker :style="{width: '256px'}" /> - </div> - - <a-tab-pane loading="true" tab="鍙楃悊鐩戠" key="1"> - <a-row> - <a-col :xl="16" :lg="12" :md="12" :sm="24" :xs="24"> - <index-bar title="鍙楃悊閲忕粺璁�" /> - </a-col> - <a-col :xl="8" :lg="12" :md="12" :sm="24" :xs="24"> - - <a-card title="蹇�熷紑濮� / 渚挎嵎瀵艰埅" style="margin-bottom: 24px" :bordered="false" :body-style="{padding: 0}"> - <div class="item-group"> - <a-row> - <a-col :class="'more-btn'" :span="12" v-for="(item,index) in registerTypeList" :key=" 'registerType'+index "> - <a-button @click="goPage(index)" style="margin-bottom:10px" size="small" type="primary" ghost>{{ item.text }}</a-button> - </a-col> - </a-row> - </div> - </a-card> - - </a-col> - </a-row> - </a-tab-pane> - - <a-tab-pane tab="浜や簰鐩戠" key="2"> - <a-row> - <a-col :xl="16" :lg="12" :md="12" :sm="24" :xs="24"> - <bar-multid :sourceData="jhjgData" :fields="jhjgFields" title="骞冲彴涓庨儴闂ㄤ氦浜掗噺缁熻"></bar-multid> - </a-col> - <a-col :xl="8" :lg="12" :md="12" :sm="24" :xs="24"> - - <a-card title="蹇�熷紑濮� / 渚挎嵎瀵艰埅" style="margin-bottom: 24px" :bordered="false" :body-style="{padding: 0}"> - <div class="item-group"> - <a-row> - <a-col :class="'more-btn'" :span="12" v-for="(item,index) in registerTypeList" :key=" 'registerType'+index "> - <a-button @click="goPage(index)" style="margin-bottom:10px" size="small" type="primary" ghost>{{ item.text }}</a-button> - </a-col> - </a-row> - </div> - </a-card> - - </a-col> - </a-row> - </a-tab-pane> - - <a-tab-pane tab="瀛樺偍鐩戠" key="4"> - <a-row> - <a-col :xl="16" :lg="12" :md="12" :sm="24" :xs="24"> - <a-row> - <template v-if="diskInfo && diskInfo.length>0"> - <a-col :span="12" v-for="(item,index) in diskInfo" :key=" 'diskInfo'+index "> - <dash-chart-demo :title="item.name" :datasource="item.restPPT"></dash-chart-demo> - </a-col> - </template> - </a-row> - </a-col> - - <a-col :xl="8" :lg="12" :md="12" :sm="24" :xs="24"> - - <a-card title="蹇�熷紑濮� / 渚挎嵎瀵艰埅" style="margin-bottom: 24px" :bordered="false" :body-style="{padding: 0}"> - <div class="item-group"> - <a-row> - <a-col :class="'more-btn'" :span="10" v-for="(item,index) in registerTypeList" :key=" 'registerType'+index "> - <a-button @click="goPage(index)" style="margin-bottom:10px" size="small" type="primary" ghost>{{ item.text }}</a-button> - </a-col> - </a-row> - </div> - </a-card> - - </a-col> - </a-row> - </a-tab-pane> - - </a-tabs> - - </div> - </a-card> - - <a-row :gutter="12"> - <a-card :loading="loading" :class="{ 'anty-list-cust':true }" :bordered="false" :style="{ marginTop: '24px' }"> - - <a-tabs v-model="indexBottomTab" size="large" :tab-bar-style="{marginBottom: '24px', paddingLeft: '16px'}"> - <div class="extra-wrapper" slot="tabBarExtraContent"> - <a-radio-group v-model="indexRegisterType" @change="changeRegisterType"> - <a-radio-button value="杞Щ鐧昏">杞Щ鐧昏</a-radio-button> - <a-radio-button value="鎶垫娂鐧昏">鎶垫娂鐧昏</a-radio-button> - <a-radio-button value="">鎵�鏈�</a-radio-button> - </a-radio-group> - </div> - - <a-tab-pane loading="true" tab="涓氬姟娴佺▼闄愭椂鐩戠" key="1"> - - <a-table :dataSource="dataSource1" size="default" rowKey="id" :columns="columns" :pagination="ipagination1" @change="tableChange1"> - <template slot="flowRate" slot-scope="text, record, index"> - <a-progress :strokeColor="getPercentColor(record.flowRate)" :format="getPercentFormat" :percent="getFlowRateNumber(record.flowRate)" style="width:80px" /> - </template> - </a-table> - </a-tab-pane> - - <a-tab-pane loading="true" tab="涓氬姟鑺傜偣闄愭椂鐩戠" key="2"> - <a-table :dataSource="dataSource2" size="default" rowKey="id" :columns="columns2" :pagination="ipagination2" @change="tableChange2"> - <template slot="flowRate" slot-scope="text, record, index"> - <span style="color: red;">{{ record.flowRate }}灏忔椂</span> - </template> - </a-table> - </a-tab-pane> - - </a-tabs> - - - </a-card> - </a-row> - - </div> -</template> - -<script> - - import ACol from "ant-design-vue/es/grid/Col" - import ATooltip from "ant-design-vue/es/tooltip/Tooltip" - import ChartCard from '@/components/ChartCard' - import MiniBar from '@/components/chart/MiniBar' - import MiniArea from '@/components/chart/MiniArea' - import IndexBar from '@/components/chart/IndexBar' - import BarMultid from '@/components/chart/BarMultid' - import DashChartDemo from '@/components/chart/DashChartDemo' - - const jhjgData = [ - { type: '鎴跨', '1鏈�': 900, '2鏈�': 1120, '3鏈�': 1380, '4鏈�': 1480, '5鏈�': 1450, '6鏈�': 1100, '7鏈�':1300, '8鏈�':900,'9鏈�':1000 ,'10鏈�':1200 ,'11鏈�':600 ,'12鏈�':900 }, - { type: '绋庡姟', '1鏈�':1200, '2鏈�': 1500, '3鏈�': 1980, '4鏈�': 2000, '5鏈�': 1000, '6鏈�': 600, '7鏈�':900, '8鏈�':1100,'9鏈�':1300 ,'10鏈�':2000 ,'11鏈�':900 ,'12鏈�':1100 }, - { type: '涓嶅姩浜�', '1鏈�':2000, '2鏈�': 1430, '3鏈�': 1300, '4鏈�': 1400, '5鏈�': 900, '6鏈�': 500, '7鏈�':600, '8鏈�':1000,'9鏈�':600 ,'10鏈�':1000 ,'11鏈�':1500 ,'12鏈�':1200 } - ] - - const jhjgFields=[ - '1鏈�','2鏈�','3鏈�','4鏈�','5鏈�','6鏈�', - '7鏈�','8鏈�','9鏈�','10鏈�','11鏈�','12鏈�' - ] - - const xljgData = [ - {type:'涓�鏈�',"鎴跨":1.12,"绋庡姟":1.55,"涓嶅姩浜�":1.2}, - {type:'浜屾湀',"鎴跨":1.65,"绋庡姟":1.32,"涓嶅姩浜�":1.42}, - {type:'涓夋湀',"鎴跨":1.85,"绋庡姟":1.1,"涓嶅姩浜�":1.5}, - - {type:'鍥涙湀',"鎴跨":1.33,"绋庡姟":1.63,"涓嶅姩浜�":1.4}, - {type:'浜旀湀',"鎴跨":1.63,"绋庡姟":1.8,"涓嶅姩浜�":1.7}, - {type:'鍏湀',"鎴跨":1.85,"绋庡姟":1.98,"涓嶅姩浜�":1.8}, - - {type:'涓冩湀',"鎴跨":1.98,"绋庡姟":1.5,"涓嶅姩浜�":1.76}, - {type:'鍏湀',"鎴跨":1.48,"绋庡姟":1.2,"涓嶅姩浜�":1.3}, - {type:'涔濇湀',"鎴跨":1.41,"绋庡姟":1.9,"涓嶅姩浜�":1.6}, - - {type:'鍗佹湀',"鎴跨":1.1,"绋庡姟":1.1,"涓嶅姩浜�":1.4}, - {type:'鍗佷竴鏈�',"鎴跨":1.85,"绋庡姟":1.6,"涓嶅姩浜�":1.5}, - {type:'鍗佷簩鏈�',"鎴跨":1.5,"绋庡姟":1.4,"涓嶅姩浜�":1.3} - ] - const xljgFields=["鎴跨","绋庡姟","涓嶅姩浜�"] - - const dataCol1 = [{ - title: '涓氬姟鍙�', - align:"center", - dataIndex: 'reBizCode' - },{ - title: '涓氬姟绫诲瀷', - align:"center", - dataIndex: 'type' - },{ - title: '鍙楃悊浜�', - align:"center", - dataIndex: 'acceptBy' - },{ - title: '鍙楃悊鏃堕棿', - align:"center", - dataIndex: 'acceptDate' - },{ - title: '褰撳墠鑺傜偣', - align:"center", - dataIndex: 'curNode' - },{ - title: '鍔炵悊鏃堕暱', - align:"center", - dataIndex: 'flowRate', - scopedSlots: { customRender: 'flowRate' } - }]; - const dataSource1=[ - {reBizCode:"1",type:"杞Щ鐧昏",acceptBy:'寮犱笁',acceptDate:"2019-01-22",curNode:"浠诲姟鍒嗘淳",flowRate:60}, - {reBizCode:"2",type:"鎶垫娂鐧昏",acceptBy:'鏉庡洓',acceptDate:"2019-01-23",curNode:"棰嗗瀹℃牳",flowRate:30}, - {reBizCode:"3",type:"杞Щ鐧昏",acceptBy:'鐜嬫',acceptDate:"2019-01-25",curNode:"浠诲姟澶勭悊",flowRate:20}, - {reBizCode:"4",type:"杞Щ鐧昏",acceptBy:'璧垫ゼ',acceptDate:"2019-11-22",curNode:"閮ㄩ棬瀹℃牳",flowRate:80}, - {reBizCode:"5",type:"杞Щ鐧昏",acceptBy:'閽卞氨',acceptDate:"2019-12-12",curNode:"浠诲姟鍒嗘淳",flowRate:90}, - {reBizCode:"6",type:"杞Щ鐧昏",acceptBy:'瀛欏惂',acceptDate:"2019-03-06",curNode:"浠诲姟澶勭悊",flowRate:10}, - {reBizCode:"7",type:"鎶垫娂鐧昏",acceptBy:'鍛ㄥぇ',acceptDate:"2019-04-13",curNode:"浠诲姟鍒嗘淳",flowRate:100}, - {reBizCode:"8",type:"鎶垫娂鐧昏",acceptBy:'鍚翠簩',acceptDate:"2019-05-09",curNode:"浠诲姟涓婃姤",flowRate:50}, - {reBizCode:"9",type:"鎶垫娂鐧昏",acceptBy:'閮戠埥',acceptDate:"2019-07-12",curNode:"浠诲姟澶勭悊",flowRate:63}, - {reBizCode:"20",type:"鎶垫娂鐧昏",acceptBy:'鏋楁湁',acceptDate:"2019-12-12",curNode:"浠诲姟鎵撳洖",flowRate:59}, - {reBizCode:"11",type:"杞Щ鐧昏",acceptBy:'鐮佷簯',acceptDate:"2019-09-10",curNode:"浠诲姟绛炬敹",flowRate:87}, - ] - - const dataCol2 = [{ - title: '涓氬姟鍙�', - align:"center", - dataIndex: 'reBizCode' - },{ - title: '鍙楃悊浜�', - align:"center", - dataIndex: 'acceptBy' - },{ - title: '鍙戣捣鏃堕棿', - align:"center", - dataIndex: 'acceptDate' - },{ - title: '褰撳墠鑺傜偣', - align:"center", - dataIndex: 'curNode' - },{ - title: '瓒呮椂鏃堕棿', - align:"center", - dataIndex: 'flowRate', - scopedSlots: { customRender: 'flowRate' } - }]; - const dataSource2=[ - {reBizCode:"A001",type:"杞Щ鐧昏",acceptBy:'寮犲洓',acceptDate:"2019-01-22",curNode:"浠诲姟鍒嗘淳",flowRate:12}, - {reBizCode:"A002",type:"鎶垫娂鐧昏",acceptBy:'鏉庡惂',acceptDate:"2019-01-23",curNode:"浠诲姟绛炬敹",flowRate:3}, - {reBizCode:"A003",type:"杞Щ鐧昏",acceptBy:'鐜嬩笁',acceptDate:"2019-01-25",curNode:"浠诲姟澶勭悊",flowRate:24}, - {reBizCode:"A004",type:"杞Щ鐧昏",acceptBy:'璧典簩',acceptDate:"2019-11-22",curNode:"閮ㄩ棬瀹℃牳",flowRate:10}, - {reBizCode:"A005",type:"杞Щ鐧昏",acceptBy:'閽卞ぇ',acceptDate:"2019-12-12",curNode:"浠诲姟绛炬敹",flowRate:8}, - {reBizCode:"A006",type:"杞Щ鐧昏",acceptBy:'瀛欏氨',acceptDate:"2019-03-06",curNode:"浠诲姟澶勭悊",flowRate:10}, - {reBizCode:"A007",type:"鎶垫娂鐧昏",acceptBy:'鍛ㄦ檿',acceptDate:"2019-04-13",curNode:"閮ㄩ棬瀹℃牳",flowRate:24}, - {reBizCode:"A008",type:"鎶垫娂鐧昏",acceptBy:'鍚存湁',acceptDate:"2019-05-09",curNode:"閮ㄩ棬瀹℃牳",flowRate:30}, - {reBizCode:"A009",type:"鎶垫娂鐧昏",acceptBy:'閮戞',acceptDate:"2019-07-12",curNode:"浠诲姟鍒嗘淳",flowRate:1}, - {reBizCode:"A0010",type:"鎶垫娂鐧昏",acceptBy:'鏋楃埥',acceptDate:"2019-12-12",curNode:"閮ㄩ棬瀹℃牳",flowRate:16}, - {reBizCode:"A0011",type:"杞Щ鐧昏",acceptBy:'鐮佹ゼ',acceptDate:"2019-09-10",curNode:"閮ㄩ棬瀹℃牳",flowRate:7}, - ] - - export default { - name: "IndexBdc", - components: { - ATooltip, - ACol, - ChartCard, - MiniArea, - MiniBar, - DashChartDemo, - BarMultid, - IndexBar - }, - data() { - return { - loading: true, - cardCount:{ - sll:100, - bjl:87, - isll:15, - ibjl:9 - }, - - todaySll:60, - todayBjl:54, - todayISll:13, - todayIBjl:7, - - chartData:{ - sll:[], - bjl:[], - isll:[], - ibjl:[] - }, - jhjgFields, - jhjgData, - - xljgData, - xljgFields, - - diskInfo:[ - {name:"C鐩�",restPPT:7}, - {name:"D鐩�",restPPT:5} - ], - - registerTypeList:[{ - text:"涓氬姟鍙楃悊" - },{ - text:"涓氬姟绠$悊" - },{ - text:"鏂囦欢绠$悊" - },{ - text:"淇℃伅鏌ヨ" - }], - - dataSource1:[], - dataSource2:[], - columns:dataCol1, - columns2:dataCol2, - ipagination1:{ - current: 1, - pageSize: 5, - pageSizeOptions: ['10', '20', '30'], - showTotal: (total, range) => { - return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" - }, - showQuickJumper: true, - showSizeChanger: true, - total: 0, - - }, - ipagination2:{ - current: 1, - pageSize: 5, - pageSizeOptions: ['10', '20', '30'], - showTotal: (total, range) => { - return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" - }, - showQuickJumper: true, - showSizeChanger: true, - total: 0, - }, - indexRegisterType:"杞Щ鐧昏", - indexBottomTab:"1" - - } - }, - methods:{ - goPage(){ - this.$message.success("鏍规嵁涓氬姟鑷澶勭悊璺宠浆椤甸潰!") - }, - changeRegisterType(e){ - this.indexRegisterType = e.target.value - if(this.indexBottomTab=="1"){ - this.loadDataSource1() - }else{ - this.loadDataSource2() - } - }, - tableChange1(pagination){ - this.ipagination1.current = pagination.current - this.ipagination1.pageSize = pagination.pageSize - this.queryTimeoutInfo() - }, - tableChange2(pagination){ - this.ipagination2.current = pagination.current - this.ipagination2.pageSize = pagination.pageSize - this.queryNodeTimeoutInfo() - }, - getFlowRateNumber(value){ - return Number(value) - }, - getPercentFormat(value){ - if(value==100){ - return "瓒呮椂" - }else{ - return value+"%" - } - }, - getPercentColor(value){ - let p = Number(value) - if(p>=90 && p<100){ - return 'rgb(244, 240, 89)' - }else if(p>=100){ - return 'red' - }else{ - return 'rgb(16, 142, 233)' - } - }, - - loadDataSource1(){ - this.dataSource1 = dataSource1.filter(item=>{ - if(!this.indexRegisterType){ - return true - } - return item.type==this.indexRegisterType - }) - }, - loadDataSource2(){ - this.dataSource2 = dataSource2.filter(item=>{ - if(!this.indexRegisterType){ - return true - } - return item.type==this.indexRegisterType - }) - } - }, - created() { - this.loadDataSource1() - this.loadDataSource2() - setTimeout(() => { - this.loading = !this.loading - }, 1000) - } - } -</script> - -<style lang="less" scoped> - .extra-wrapper { - line-height: 55px; - padding-right: 24px; - - .extra-item { - display: inline-block; - margin-right: 24px; - - a { - margin-left: 24px; - } - } - } - - .item-group { - padding: 20px 0 8px 24px; - font-size: 0; - a { - color: rgba(0, 0, 0, 0.65); - display: inline-block; - font-size: 14px; - margin-bottom: 13px; - width: 25%; - } - } - - .item-group { - .more-btn { - margin-bottom: 13px; - text-align: center; - } - } - - .list-content-item { - color: rgba(0, 0, 0, .45); - display: inline-block; - vertical-align: middle; - font-size: 14px; - margin-left: 40px; - } - - @media only screen and (min-width: 1600px) { - .list-content-item{ - margin-left:60px; - } - } - - @media only screen and (max-width: 1300px) { - .list-content-item{ - margin-left:20px; - } - .width-hidden4{ - display:none - } - } - .list-content-item{ - span{line-height: 20px;} - } - .list-content-item{ - p{margin-top: 4px;margin-bottom:0;line-height:22px;} - } - .anty-list-cust { - .ant-list-item-meta{flex: 0.3 !important;} - } - .anty-list-cust { - .ant-list-item-content{flex:1 !important; justify-content:flex-start !important;margin-left: 20px;} - } - - -</style> \ No newline at end of file diff --git a/src/views/dashboard/IndexChart.vue b/src/views/dashboard/IndexChart.vue deleted file mode 100644 index 60ac1f5..0000000 --- a/src/views/dashboard/IndexChart.vue +++ /dev/null @@ -1,268 +0,0 @@ -<template> - <div class="page-header-index-wide"> - <a-row :gutter="24"> - <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }"> - <chart-card :loading="loading" title="鎬婚攢鍞" total="锟�126,560"> - <a-tooltip title="鎸囨爣璇存槑" slot="action"> - <a-icon type="info-circle-o" /> - </a-tooltip> - <div> - <trend flag="up" style="margin-right: 16px;"> - <span slot="term">鍛ㄥ悓姣�</span> - 12% - </trend> - <trend flag="down"> - <span slot="term">鏃ュ悓姣�</span> - 11% - </trend> - </div> - <template slot="footer">鏃ュ潎閿�鍞<span>锟� 234.56</span></template> - </chart-card> - </a-col> - <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }"> - <chart-card :loading="loading" title="璁㈠崟閲�" :total="8846 | NumberFormat"> - <a-tooltip title="鎸囨爣璇存槑" slot="action"> - <a-icon type="info-circle-o" /> - </a-tooltip> - <div> - <mini-area /> - </div> - <template slot="footer">鏃ヨ鍗曢噺<span> {{ '1234' | NumberFormat }}</span></template> - </chart-card> - </a-col> - <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }"> - <chart-card :loading="loading" title="鏀粯绗旀暟" :total="6560 | NumberFormat"> - <a-tooltip title="鎸囨爣璇存槑" slot="action"> - <a-icon type="info-circle-o" /> - </a-tooltip> - <div> - <mini-bar :height="40" /> - </div> - <template slot="footer">杞寲鐜� <span>60%</span></template> - </chart-card> - </a-col> - <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }"> - <chart-card :loading="loading" title="杩愯惀娲诲姩鏁堟灉" total="78%"> - <a-tooltip title="鎸囨爣璇存槑" slot="action"> - <a-icon type="info-circle-o" /> - </a-tooltip> - <div> - <mini-progress color="rgb(19, 194, 194)" :target="80" :percentage="78" :height="8" /> - </div> - <template slot="footer"> - <trend flag="down" style="margin-right: 16px;"> - <span slot="term">鍚屽懆姣�</span> - 12% - </trend> - <trend flag="up"> - <span slot="term">鏃ョ幆姣�</span> - 80% - </trend> - </template> - </chart-card> - </a-col> - </a-row> - - <a-card :loading="loading" :bordered="false" :body-style="{padding: '0'}"> - <div class="salesCard"> - <a-tabs default-active-key="1" size="large" :tab-bar-style="{marginBottom: '24px', paddingLeft: '16px'}"> - <div class="extra-wrapper" slot="tabBarExtraContent"> - <div class="extra-item"> - <a>浠婃棩</a> - <a>鏈懆</a> - <a>鏈湀</a> - <a>鏈勾</a> - </div> - <a-range-picker :style="{width: '256px'}" /> - </div> - <a-tab-pane loading="true" tab="閿�鍞" key="1"> - <a-row> - <a-col :xl="16" :lg="12" :md="12" :sm="24" :xs="24"> - <bar title="閿�鍞鎺掕" :dataSource="barData"/> - </a-col> - <a-col :xl="8" :lg="12" :md="12" :sm="24" :xs="24"> - <rank-list title="闂ㄥ簵閿�鍞帓琛屾" :list="rankList"/> - </a-col> - </a-row> - </a-tab-pane> - <a-tab-pane tab="閿�鍞秼鍔�" key="2"> - <a-row> - <a-col :xl="16" :lg="12" :md="12" :sm="24" :xs="24"> - <bar title="閿�鍞瓒嬪娍" :dataSource="barData"/> - </a-col> - <a-col :xl="8" :lg="12" :md="12" :sm="24" :xs="24"> - <rank-list title="闂ㄥ簵閿�鍞帓琛屾" :list="rankList"/> - </a-col> - </a-row> - </a-tab-pane> - </a-tabs> - </div> - </a-card> - - <a-row> - <a-col :span="24"> - <a-card :loading="loading" :bordered="false" title="鏈�杩戜竴鍛ㄨ闂噺缁熻" :style="{ marginTop: '24px' }"> - <a-row> - <a-col :span="6"> - <head-info title="浠婃棩IP" :content="loginfo.todayIp"></head-info> - </a-col> - <a-col :span="2"> - <a-spin class='circle-cust'> - <a-icon slot="indicator" type="environment" style="font-size: 24px" /> - </a-spin> - </a-col> - <a-col :span="6"> - <head-info title="浠婃棩璁块棶" :content="loginfo.todayVisitCount"></head-info> - </a-col> - <a-col :span="2"> - <a-spin class='circle-cust'> - <a-icon slot="indicator" type="team" style="font-size: 24px" /> - </a-spin> - </a-col> - <a-col :span="6"> - <head-info title="鎬昏闂噺" :content="loginfo.totalVisitCount"></head-info> - </a-col> - <a-col :span="2"> - <a-spin class='circle-cust'> - <a-icon slot="indicator" type="rise" style="font-size: 24px" /> - </a-spin> - </a-col> - </a-row> - <line-chart-multid :fields="visitFields" :dataSource="visitInfo"></line-chart-multid> - </a-card> - </a-col> - </a-row> - </div> -</template> - -<script> - import ChartCard from '@/components/ChartCard' - import ACol from "ant-design-vue/es/grid/Col" - import ATooltip from "ant-design-vue/es/tooltip/Tooltip" - import MiniArea from '@/components/chart/MiniArea' - import MiniBar from '@/components/chart/MiniBar' - import MiniProgress from '@/components/chart/MiniProgress' - import RankList from '@/components/chart/RankList' - import Bar from '@/components/chart/Bar' - import LineChartMultid from '@/components/chart/LineChartMultid' - import HeadInfo from '@/components/tools/HeadInfo.vue' - - import Trend from '@/components/Trend' - import { getLoginfo,getVisitInfo } from '@/api/api' - - const rankList = [] - for (let i = 0; i < 7; i++) { - rankList.push({ - name: '鐧介弓宀� ' + (i+1) + ' 鍙峰簵', - total: 1234.56 - i * 100 - }) - } - const barData = [] - for (let i = 0; i < 12; i += 1) { - barData.push({ - x: `${i + 1}鏈坄, - y: Math.floor(Math.random() * 1000) + 200 - }) - } - export default { - name: "IndexChart", - components: { - ATooltip, - ACol, - ChartCard, - MiniArea, - MiniBar, - MiniProgress, - RankList, - Bar, - Trend, - LineChartMultid, - HeadInfo - }, - data() { - return { - loading: true, - center: null, - rankList, - barData, - loginfo:{}, - visitFields:['ip','visit'], - visitInfo:[], - indicator: <a-icon type="loading" style="font-size: 24px" spin /> - } - }, - created() { - setTimeout(() => { - this.loading = !this.loading - }, 1000) - this.initLogInfo(); - }, - methods: { - initLogInfo () { - getLoginfo(null).then((res)=>{ - if(res.success){ - Object.keys(res.result).forEach(key=>{ - res.result[key] =res.result[key]+"" - }) - this.loginfo = res.result; - } - }) - getVisitInfo().then(res=>{ - if(res.success){ - this.visitInfo = res.result; - } - }) - }, - } - } -</script> - -<style lang="less" scoped> - .circle-cust{ - position: relative; - top: 28px; - left: -100%; - } - .extra-wrapper { - line-height: 55px; - padding-right: 24px; - - .extra-item { - display: inline-block; - margin-right: 24px; - - a { - margin-left: 24px; - } - } - } - - /* 棣栭〉璁块棶閲忕粺璁� */ - .head-info { - position: relative; - text-align: left; - padding: 0 32px 0 0; - min-width: 125px; - - &.center { - text-align: center; - padding: 0 32px; - } - - span { - color: rgba(0, 0, 0, .45); - display: inline-block; - font-size: .95rem; - line-height: 42px; - margin-bottom: 4px; - } - p { - line-height: 42px; - margin: 0; - a { - font-weight: 600; - font-size: 1rem; - } - } - } -</style> \ No newline at end of file diff --git a/src/views/dashboard/IndexTask.vue b/src/views/dashboard/IndexTask.vue deleted file mode 100644 index 8e9d84b..0000000 --- a/src/views/dashboard/IndexTask.vue +++ /dev/null @@ -1,372 +0,0 @@ -<template> - <div class="index-container-ty"> - <a-spin :spinning="loading"> - <a-row type="flex" justify="start" :gutter="3"> - <a-col :sm="24" :lg="12"> - <a-card> - <div slot="title" class="index-md-title"> - <img src="../../assets/daiban.png"/> - 鎴戠殑寰呭姙銆恵{ dataSource1.length }}銆� - </div> - <div slot="extra"> - <a v-if="dataSource1 && dataSource1.length>0" slot="footer" @click="goPage">鏇村 <a-icon type="double-right" /></a> - </div> - <a-table - :class="'my-index-table tytable1'" - ref="table1" - size="small" - rowKey="id" - :columns="columns" - :dataSource="dataSource1" - :pagination="false"> - <template slot="ellipsisText" slot-scope="text"> - <j-ellipsis :value="text" :length="textMaxLength"></j-ellipsis> - </template> - - <template slot="dayWarnning" slot-scope="text,record"> - <a-icon type="bulb" theme="twoTone" style="font-size:22px" :twoToneColor="getTipColor(record)"/> - </template> - - <span slot="action" slot-scope="text, record"> - <a @click="handleData">鍔炵悊</a> - </span> - - </a-table> - </a-card> - </a-col> - - <a-col :sm="24" :lg="12"> - <a-card> - <div slot="title" class="index-md-title"> - <img src="../../assets/zaiban.png"/> - 鎴戠殑鍦ㄥ姙銆恵{ dataSource2.length }}銆� - </div> - <div slot="extra"> - <a v-if="dataSource2 && dataSource2.length>0" slot="footer" @click="goPage">鏇村 <a-icon type="double-right" /></a> - </div> - <a-table - :class="'my-index-table tytable2'" - ref="table2" - size="small" - rowKey="id" - :columns="columns" - :dataSource="dataSource2" - :pagination="false"> - <template slot="ellipsisText" slot-scope="text"> - <j-ellipsis :value="text" :length="textMaxLength"></j-ellipsis> - </template> - - <template slot="dayWarnning" slot-scope="text,record"> - <a-icon type="bulb" theme="twoTone" style="font-size:22px" :twoToneColor="getTipColor(record)"/> - </template> - - <span slot="action" slot-scope="text, record"> - <a @click="handleData">鍔炵悊</a> - </span> - - </a-table> - </a-card> - </a-col> - - <a-col :span="24"> - <div style="height: 5px;"></div> - </a-col> - - <a-col :sm="24" :lg="12"> - <a-card> - <div slot="title" class="index-md-title"> - <img src="../../assets/guaz.png"/> - 鎴戠殑鎸傝处銆恵{ dataSource4.length }}銆� - </div> - <a-table - :class="'my-index-table tytable4'" - ref="table4" - size="small" - rowKey="id" - :columns="columns" - :dataSource="dataSource4" - :pagination="false"> - <template slot="ellipsisText" slot-scope="text"> - <j-ellipsis :value="text" :length="textMaxLength"></j-ellipsis> - </template> - - <template slot="dayWarnning" slot-scope="text,record"> - <a-icon type="bulb" theme="twoTone" style="font-size:22px" :twoToneColor="getTipColor(record)"/> - </template> - - <span slot="action" slot-scope="text, record"> - <a @click="handleData">鍔炵悊</a> - </span> - - </a-table> - </a-card> - </a-col> - - <a-col :sm="24" :lg="12"> - <a-card> - <div slot="title" class="index-md-title"> - <img src="../../assets/duban.png"/> - 鎴戠殑鐫e姙銆恵{ dataSource3.length }}銆� - </div> - <a-table - :class="'my-index-table tytable3'" - ref="table3" - size="small" - rowKey="id" - :columns="columns" - :dataSource="dataSource3" - :pagination="false"> - <template slot="ellipsisText" slot-scope="text"> - <j-ellipsis :value="text" :length="textMaxLength"></j-ellipsis> - </template> - - <template slot="dayWarnning" slot-scope="text,record"> - <a-icon type="bulb" theme="twoTone" style="font-size:22px" :twoToneColor="getTipColor(record)"/> - </template> - - <span slot="action" slot-scope="text, record"> - <a @click="handleData">鍔炵悊</a> - </span> - - </a-table> - </a-card> - </a-col> - - </a-row> - </a-spin> - - </div> -</template> - -<script> - import noDataPng from '@/assets/nodata.png' - import JEllipsis from '@/components/jeecg/JEllipsis' - - const tempSs1=[{ - id:"001", - orderNo:"鐢礫1]1267102", - orderTitle:"鑽搧鍑洪棶棰樹簡", - restDay:1 - },{ - id:"002", - orderNo:"鐢礫4]5967102", - orderTitle:"鍚冧簡xxx鍖婚櫌鐨勮嵂锛岀梾鎯呰秺鏉ヨ秺涓ラ噸", - restDay:0 - },{ - id:"003", - orderNo:"鐢礫3]5988987", - orderTitle:"浠婂ぉ鍘昏秴甯備拱楦¤泲锛岄浮铔嬮兘鏄潖鐨�", - restDay:7 - },{ - id:"004", - orderNo:"鐢礫2]5213491", - orderTitle:"xx瀹濆疄浣撳簵楂樹环鍞崠xx", - restDay:5 - },{ - id:"005", - orderNo:"鐢礫1]1603491", - orderTitle:"浠ョ孩鍒╃浉璇憋紝绛斿簲閫�淇濆悗鎵d竴骞磋垂鐢�", - restDay:0 - }] - - const tempSs2=[{ - id:"001", - orderTitle:"鎴戣鎶曡瘔杩欎釜澶ц秴甯�", - orderNo:"鐢礫1]10299456", - restDay:6 - },{ - id:"002", - orderTitle:"xxx鍖婚櫌涔卞紑鑽柟,鍞崠鍋囪嵂", - orderNo:"鐢礫2]20235691", - restDay:0 - },{ - id:"003", - orderTitle:"鎴戞兂闂棶杩欏搴楁槸骞插暐鐨�", - orderNo:"鐢礫3]495867322", - restDay:7 - },{ - id:"004", - orderTitle:"鎴戣涓炬姤鏈濋槼鍖哄ゥ妫叕鍥厭搴�", - orderNo:"鐢礫2]1193849", - restDay:3 - },{ - id:"005", - orderTitle:"鎴戜粖澶╁悆楗悆鍒颁竴涓煶澶村瓙", - orderNo:"鐢礫4]56782344", - restDay:9 - }] - - //4-7澶� - const tip_green = "rgba(0, 255, 0, 1)" - //1-3澶� - const tip_yellow = "rgba(255, 255, 0, 1)" - //瓒呮湡 - const tip_red = "rgba(255, 0, 0, 1)" - - export default { - name: "IndexTask", - components:{ JEllipsis }, - data() { - return { - loading:false, - textMaxLength:8, - dataSource1:[], - dataSource2:[], - dataSource3:[], - dataSource4:[], - columns: [ - { - title: '', - dataIndex: '', - key:'rowIndex', - width:50, - fixed:'left', - align:"center", - scopedSlots: {customRender: "dayWarnning"} - }, - { - title:'鍓╀綑澶╂暟', - align:"center", - dataIndex: 'restDay', - width:80 - }, - { - title:'宸ュ崟鏍囬', - align:"center", - dataIndex: 'orderTitle', - scopedSlots: {customRender: "ellipsisText"} - }, - { - title:'宸ュ崟缂栧彿', - align:"center", - dataIndex: 'orderNo', - }, - { - title: '鎿嶄綔', - dataIndex: 'action', - align:"center", - scopedSlots: { customRender: 'action' } - } - ] - - } - }, - created() { - this.mock(); - }, - mounted(){ - - }, - methods: { - getTipColor(rd){ - let num = rd.restDay - if(num<=0){ - return tip_red - }else if(num>=1 && num<4){ - return tip_yellow - }else if(num>=4){ - return tip_green - } - }, - goPage(){ - this.$message.success("璇锋牴鎹叿浣撲笟鍔¤烦杞〉闈�") - //this.$router.push({ path: '/comp/mytask' }) - }, - mock(){ - this.dataSource1=tempSs1 - this.dataSource2=tempSs2 - this.dataSource3=tempSs1 - this.dataSource4=[] - this.ifNullDataSource(this.dataSource4,'.tytable4') - }, - - ifNullDataSource(ds,tb){ - this.$nextTick(()=>{ - if(!ds || ds.length==0){ - var tmp = document.createElement('img'); - tmp.src=noDataPng - tmp.width=300 - let tbclass=`${tb} .ant-table-placeholder` - document.querySelector(tbclass).innerHTML="" - document.querySelector(tbclass).appendChild(tmp) - } - }) - }, - handleData(){ - this.$message.success("鍔炵悊瀹屾垚") - } - - - - - } - } -</script> - -<style> - .my-index-table{height:270px} - .my-index-table table{font-size: 14px !important;} - - .index-container-ty .ant-card-head-title{padding-top: 6px;padding-bottom: 6px;} - .index-container-ty .ant-card-extra{padding:0} - .index-container-ty .ant-card-extra a{color:#fff} - .index-container-ty .ant-card-extra a:hover{color:#152ede} - .index-container-ty .ant-card-head-wrapper,.index-container-ty .ant-card-head{ - line-height:24px; - min-height:24px; - /*background: #90aeff;*/ - background: #7196fb; - } - .index-container-ty .ant-card-body{padding: 10px 12px 0px 12px} - - /* .index-container-ty .ant-card-actions{background: #fff} - .index-container-ty .ant-card-actions li {margin:2px 0;} - .index-container-ty .ant-card-actions > li > span{width: 100%}*/ - - - .index-container-ty .ant-table-footer{text-align: right;padding:6px 12px 6px 6px;background: #fff;border-top: 2px solid #f7f1f1;} - - .index-md-title{ - postion:relative; - padding-left:24px; - width: 100%; - color: #fff; - font-size: 21px; - font-family: cursive; - } - .index-md-title img{ - position: absolute; - height:32px; - top: 2px; - left:14px; - } - - .index-container-ty .ant-card-body{ - /*border-left:1px solid #90aeff; - /*border-right:1px solid #90aeff; - border-bottom:1px solid #90aeff;*/ - } - - - .index-container-ty .ant-table-thead > tr > th, - .index-container-ty .ant-table-tbody > tr > td{ - border-bottom: 1px solid #90aeff; - } - - .index-container-ty .ant-table-small > .ant-table-content > .ant-table-fixed-left > .ant-table-body-outer > .ant-table-body-inner > table > .ant-table-thead > tr > th, - .index-container-ty .ant-table-small > .ant-table-content > .ant-table-fixed-right > .ant-table-body-outer > .ant-table-body-inner > table > .ant-table-thead > tr > th{ - border-bottom: 1px solid #90aeff; - } - - .index-container-ty .ant-table-small > .ant-table-content > .ant-table-scroll > .ant-table-body > table > .ant-table-thead > tr > th{ - border-bottom: 1px solid #90aeff; - } - - .index-container-ty .ant-table-small{ - border: 1px solid #90aeff; - } - - .index-container-ty .ant-table-placeholder { - padding: 0 - } -</style> \ No newline at end of file diff --git a/src/views/system/UserList.vue b/src/views/system/UserList.vue index 73dceb5..f29115e 100644 --- a/src/views/system/UserList.vue +++ b/src/views/system/UserList.vue @@ -114,7 +114,7 @@ :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange"> - <template slot="avatarslot" slot-scope="text, record, index"> + <template slot="avatarslot" slot-scope="text, record"> <div class="anty-img-wrap"> <a-avatar shape="square" :src="getAvatarView(record.avatar)" icon="user"/> </div> @@ -178,6 +178,7 @@ </template> <script> + import UserModal from './modules/UserModal' import PasswordModal from './modules/PasswordModal' import {putAction,getFileAccessHttpUrl} from '@/api/manage'; @@ -188,6 +189,7 @@ import UserRecycleBinModal from './modules/UserRecycleBinModal' import JSuperQuery from '@/components/jeecg/JSuperQuery' import JThirdAppButton from '@/components/jeecgbiz/thirdApp/JThirdAppButton' + import {mapActions} from 'vuex' export default { name: "UserList", @@ -233,41 +235,42 @@ { title: '澶村儚', align: "center", - width: 120, + width: 80, dataIndex: 'avatar', scopedSlots: {customRender: "avatarslot"} }, + // { + // title: '鎬у埆', + // align: "center", + // width: 80, + // dataIndex: 'sex_dictText', + // sorter: true + // }, + // { + // title: '鐢熸棩', + // align: "center", + // width: 100, + // dataIndex: 'birthday' + // }, + // { + // title: '鎵嬫満鍙风爜', + // align: "center", + // width: 100, + // dataIndex: 'phone' + // }, + // { + // title: '閮ㄩ棬', + // align: "center", + // width: 240, + // dataIndex: 'orgCodeTxt' + // }, { - title: '鎬у埆', + title: '杞﹂棿', align: "center", - width: 80, - dataIndex: 'sex_dictText', - sorter: true - }, - { - title: '鐢熸棩', - align: "center", - width: 100, - dataIndex: 'birthday' - }, - { - title: '鎵嬫満鍙风爜', - align: "center", - width: 100, - dataIndex: 'phone' - }, - { - title: '閮ㄩ棬', - align: "center", - width: 180, - dataIndex: 'orgCodeTxt' - }, - { - title: '璐熻矗閮ㄩ棬', - align: "center", - width: 180, - dataIndex: 'departIds_dictText' + width: 240, + dataIndex: 'productionName', + ellipsis: true, }, { title: '鐘舵��', @@ -278,12 +281,14 @@ { title: '鎿嶄綔', dataIndex: 'action', - scopedSlots: {customRender: 'action'}, + scopedSlots: { customRender: 'action' }, align: "center", - width: 170 - } + width: 80 + }, + ], + isDepartType:'', superQueryFieldList: [ { type: 'input', value: 'username', text: '鐢ㄦ埛璐﹀彿', }, { type: 'input', value: 'realname', text: '鐢ㄦ埛濮撳悕', }, @@ -304,14 +309,180 @@ return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; } }, + created() { + this.queryTreeData() + }, methods: { + ...mapActions(['QueryDepartTree']), + queryTreeData() { + this.QueryDepartTree().then(res => { + if (res.success) { + this.isDepartType = res.result[0].value + if(this.isDepartType == -1){ + this.columns=[ + { + title: '鐢ㄦ埛璐﹀彿', + align: "center", + dataIndex: 'username', + width: 120, + sorter: true + }, + { + title: '鐢ㄦ埛濮撳悕', + align: "center", + width: 100, + dataIndex: 'realname', + }, + { + title: '澶村儚', + align: "center", + width: 80, + dataIndex: 'avatar', + scopedSlots: {customRender: "avatarslot"} + }, + + // { + // title: '鎬у埆', + // align: "center", + // width: 80, + // dataIndex: 'sex_dictText', + // sorter: true + // }, + // { + // title: '鐢熸棩', + // align: "center", + // width: 100, + // dataIndex: 'birthday' + // }, + // { + // title: '鎵嬫満鍙风爜', + // align: "center", + // width: 100, + // dataIndex: 'phone' + // }, + { + title: '杞﹂棿', + align: "center", + width: 240, + dataIndex: 'productionName', + ellipsis: true, + }, + { + title: '鐘舵��', + align: "center", + width: 80, + dataIndex: 'status_dictText' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + scopedSlots: { customRender: 'action' }, + align: "center", + width: 80 + }, + + + ] + }else{ + this.columns= [ + { + title: '鐢ㄦ埛璐﹀彿', + align: "center", + dataIndex: 'username', + width: 120, + sorter: true + }, + { + title: '鐢ㄦ埛濮撳悕', + align: "center", + width: 100, + dataIndex: 'realname', + }, + { + title: '澶村儚', + align: "center", + width: 80, + dataIndex: 'avatar', + scopedSlots: {customRender: "avatarslot"} + }, + + // { + // title: '鎬у埆', + // align: "center", + // width: 80, + // dataIndex: 'sex_dictText', + // sorter: true + // }, + // { + // title: '鐢熸棩', + // align: "center", + // width: 100, + // dataIndex: 'birthday' + // }, + // { + // title: '鎵嬫満鍙风爜', + // align: "center", + // width: 100, + // dataIndex: 'phone' + // }, + { + title: '閮ㄩ棬', + align: "center", + width: 240, + dataIndex: 'orgCodeTxt' + }, + { + title: '杞﹂棿', + align: "center", + width: 240, + dataIndex: 'productionName', + ellipsis: true, + }, + { + title: '鐝粍', + align: "center", + width: 240, + dataIndex: 'teamId_dictText' + }, + { + title: '鐘舵��', + align: "center", + width: 80, + dataIndex: 'status_dictText' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + scopedSlots: { customRender: 'action' }, + align: "center", + width: 80 + } + + + ] + } + + } else { + // this.$message.warn(res.message) + this.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }).finally(() =>{ + }) + }, getAvatarView: function (avatar) { return getFileAccessHttpUrl(avatar) }, batchFrozen: function (status) { if (this.selectedRowKeys.length <= 0) { - this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒'); + // this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒'); + this.$notification.warning({ + message:'娑堟伅', + description:"璇烽�夋嫨涓�鏉¤褰�" + }); return false; } else { let ids = ""; @@ -364,10 +535,16 @@ } frozenBatch({ids: id, status: status}).then((res) => { if (res.success) { - that.$message.success(res.message); + that.$notification.success({ + message:'娑堟伅', + description:res.message + }); that.loadData(); } else { - that.$message.warning(res.message); + that.$notification.warning({ + message:'娑堟伅', + description:res.message + }); } }); }, diff --git a/src/views/system/modules/UserModal.vue b/src/views/system/modules/UserModal.vue index cc7c1f0..8b4de17 100644 --- a/src/views/system/modules/UserModal.vue +++ b/src/views/system/modules/UserModal.vue @@ -1,485 +1,803 @@ <template> <a-drawer - :title="title" - :maskClosable="true" - :width="drawerWidth" - placement="right" - :closable="true" - @close="handleCancel" - :visible="visible" - style="height: 100%;"> + :title="title" + :maskClosable="true" + :width="drawerWidth" + placement="right" + :closable="true" + @close="handleCancel" + :visible="visible" + style="height: 100%;overflow: auto;padding-bottom: 53px;" + > <template slot="title"> <div style="width: 100%;"> <span>{{ title }}</span> <span style="display:inline-block;width:calc(100% - 51px);padding-right:10px;text-align: right"> - <a-button @click="toggleScreen" icon="appstore" style="height:20px;width:20px;border:0px"></a-button> + <a-button + @click="toggleScreen" + icon="appstore" + style="height:20px;width:20px;border:0px" + ></a-button> </span> </div> </template> <a-spin :spinning="confirmLoading"> - <a-form-model ref="form" :model="model" :rules="validatorRules"> + <a-form-model + ref="form" + :model="model" + :rules="validatorRules" + > - <a-form-model-item label="鐢ㄦ埛璐﹀彿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="username"> - <a-input placeholder="璇疯緭鍏ョ敤鎴疯处鍙�" v-model="model.username" :readOnly="!!model.id"/> + <a-form-model-item + label="鐢ㄦ埛璐﹀彿" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="username" + > + <a-input + placeholder="璇疯緭鍏ョ敤鎴疯处鍙�" + v-model="model.username" + :readOnly="!!model.id" + /> </a-form-model-item> <template v-if="!model.id"> - <a-form-model-item label="鐧诲綍瀵嗙爜" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="password" > - <a-input type="password" placeholder="璇疯緭鍏ョ櫥褰曞瘑鐮�" v-model="model.password" /> + <a-form-model-item + label="鐧诲綍瀵嗙爜" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="password" + > + <a-input + type="password" + placeholder="璇疯緭鍏ョ櫥褰曞瘑鐮�" + v-model="model.password" + /> </a-form-model-item> - <a-form-model-item label="纭瀵嗙爜" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmpassword" > - <a-input type="password" @blur="handleConfirmBlur" placeholder="璇烽噸鏂拌緭鍏ョ櫥褰曞瘑鐮�" v-model="model.confirmpassword"/> + <a-form-model-item + label="纭瀵嗙爜" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="confirmpassword" + > + <a-input + type="password" + @blur="handleConfirmBlur" + placeholder="璇烽噸鏂拌緭鍏ョ櫥褰曞瘑鐮�" + v-model="model.confirmpassword" + /> </a-form-model-item> </template> - <a-form-model-item label="鐢ㄦ埛濮撳悕" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="realname"> - <a-input placeholder="璇疯緭鍏ョ敤鎴峰鍚�" v-model="model.realname" /> + <a-form-model-item + label="鐢ㄦ埛濮撳悕" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="realname" + > + <a-input + placeholder="璇疯緭鍏ョ敤鎴峰鍚�" + v-model="model.realname" + /> </a-form-model-item> - <a-form-model-item label="宸ュ彿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workNo"> - <a-input placeholder="璇疯緭鍏ュ伐鍙�" v-model="model.workNo" /> + <a-form-model-item + label="宸ュ彿" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="workNo" + > + <a-input + placeholder="璇疯緭鍏ュ伐鍙�" + v-model="model.workNo" + /> </a-form-model-item> - <a-form-model-item label="鎵嬫満鍙风爜" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="phone"> - <a-input placeholder="璇疯緭鍏ユ墜鏈哄彿鐮�" v-model="model.phone" /> - </a-form-model-item> + <!--<a-form-model-item label="鑱屽姟" :labelCol="labelCol" :wrapperCol="wrapperCol">--> + <!--<j-select-position placeholder="璇烽�夋嫨鑱屽姟" :multiple="false" v-model="model.post"/>--> + <!--</a-form-model-item>--> - <a-form-model-item label="鑱屽姟" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <j-select-position placeholder="璇烽�夋嫨鑱屽姟" :multiple="false" v-model="model.post"/> - </a-form-model-item> - - <a-form-model-item label="瑙掕壊鍒嗛厤" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!roleDisabled" > + <a-form-model-item + label="瑙掕壊鍒嗛厤" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + v-show="!roleDisabled" + > <j-multi-select-tag - :disabled="disableSubmit" - v-model="model.selectedroles" - :options="rolesOptions" - placeholder="璇烽�夋嫨瑙掕壊"> + :disabled="disableSubmit" + v-model="model.selectedroles" + :options="rolesOptions" + placeholder="璇烽�夋嫨瑙掕壊" + > </j-multi-select-tag> </a-form-model-item> <!--閮ㄩ棬鍒嗛厤--> - <a-form-model-item label="閮ㄩ棬鍒嗛厤" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled"> - <j-select-depart v-model="model.selecteddeparts" :multi="true" @back="backDepartInfo" :backDepart="true" :treeOpera="true">></j-select-depart> + <!--<a-form-model-item--> + <!--v-if="isDepartType== 0"--> + <!--label="閮ㄩ棬鍒嗛厤"--> + <!--:labelCol="labelCol"--> + <!--:wrapperCol="wrapperCol"--> + <!--v-show="!departDisabled"--> + <!-->--> + <!--<j-select-depart--> + <!--v-model="model.selecteddeparts"--> + <!--:multi="true"--> + <!--@back="backDepartInfo"--> + <!--:backDepart="true"--> + <!--:treeOpera="true"--> + <!-->>--> + <!--</j-select-depart>--> + <!--</a-form-model-item>--> + + <!--杞﹂棿鍒嗛厤--> + <a-form-model-item + label="杞﹂棿鍒嗛厤" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + v-show="!productionDisabled" + > + <j-select-production + v-model="model.selectedProduction" + :multi="true" + @back="backProductionInfo" + :backProduction="true" + :treeProductOpera="true" + ></j-select-production> </a-form-model-item> - <!--绉熸埛鍒嗛厤--> - <a-form-model-item label="绉熸埛鍒嗛厤" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled"> - <j-multi-select-tag - :disabled="disableSubmit" - v-model="model.relTenantIds" - :options="tenantsOptions" - placeholder="璇烽�夋嫨绉熸埛"> - </j-multi-select-tag> - </a-form-model-item> + <!--<a-form-model-item--> + <!--label="閫夋嫨璁惧"--> + <!--:labelCol="labelCol"--> + <!--:wrapperCol="wrapperCol"--> + <!--v-show="!productionDisabled"--> + <!-->--> + <!--<a-input-search--> + <!--:readOnly="true"--> + <!--v-model="model.equipmentIds"--> + <!--@search="deviceSearch"--> + <!--enter-button--> + <!--placeholder="璇烽�夋嫨璁惧"--> + <!--:disabled="!model.selectedProduction"--> + <!--/>--> + <!--</a-form-model-item>--> - <a-form-model-item label="韬唤" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <a-radio-group v-model="model.userIdentity" @change="identityChange"> - <a-radio :value="1">鏅�氱敤鎴�</a-radio> - <a-radio :value="2">涓婄骇</a-radio> - </a-radio-group> - </a-form-model-item> - <a-form-model-item label="璐熻矗閮ㄩ棬" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="departIdShow==true"> - <j-multi-select-tag - :disabled="disableSubmit" - v-model="model.departIds" - :options="nextDepartOptions" - placeholder="璇烽�夋嫨璐熻矗閮ㄩ棬"> - </j-multi-select-tag> - </a-form-model-item> + <!--<a-form-model-item--> + <!--label="棣栭〉鏉冮檺"--> + <!--:labelCol="labelCol"--> + <!--:wrapperCol="wrapperCol"--> + <!-->--> + <!--<a-radio-group--> + <!--v-model="model.userType"--> + <!--:defaultValue="0"--> + <!-->--> + <!--<a-radio :value="4">鍏徃绾�</a-radio>--> + <!--<a-radio :value="3">杞﹂棿绾�</a-radio>--> + <!--<a-radio :value="2">宸ユ绾�</a-radio>--> + <!--<a-radio :value="1">鎿嶄綔宸�</a-radio>--> + <!--<a-radio :value="0">鏃�</a-radio>--> + <!--</a-radio-group>--> + <!--</a-form-model-item>--> - <a-form-model-item label="澶村儚" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <j-image-upload class="avatar-uploader" text="涓婁紶" v-model="model.avatar" ></j-image-upload> + <!--<a-form-model-item--> + <!--label="鐝粍鍒嗛厤"--> + <!--:labelCol="labelCol"--> + <!--:wrapperCol="wrapperCol"--> + <!--prop="teamId"--> + <!-->--> + <!--<j-dict-select-tag--> + <!--v-model="model.teamId"--> + <!--:triggerChange="true"--> + <!--dictCode="mom_base_team,name,id,del_flag = 0"--> + <!--placeholder="璇风淮鎶ょ彮缁�"--> + <!--></j-dict-select-tag>--> + <!--</a-form-model-item>--> + <!--<a-form-model-item--> + <!--label="涓績鍒嗛厤"--> + <!--:labelCol="labelCol"--> + <!--:wrapperCol="wrapperCol"--> + <!--prop="areaId"--> + <!-->--> + <!-- <j-dict-select-tag + v-model="model.areaId" + :triggerChange="true" + dictCode="mom_base_area,name,id,del_flag = 0" + placeholder="璇风淮鎶や腑蹇�" + ></j-dict-select-tag> --> + <!--<j-multi-select-tag--> + <!--:triggerChange="true"--> + <!--v-model="model.areaId"--> + <!--dictCode="mom_base_area,name,id,del_flag = 0 and type = 1"--> + <!--placeholder="璇风淮鎶や腑蹇�"--> + <!-->--> + <!--</j-multi-select-tag>--> </a-form-model-item> + <!--<a-form-model-item--> + <!--label="璐熻矗閮ㄩ棬"--> + <!--:labelCol="labelCol"--> + <!--:wrapperCol="wrapperCol"--> + <!--v-if="departIdShow==true"--> + <!-->--> + <!--<j-multi-select-tag--> + <!--:disabled="disableSubmit"--> + <!--v-model="model.departIds"--> + <!--:options="nextDepartOptions"--> + <!--placeholder="璇烽�夋嫨璐熻矗閮ㄩ棬"--> + <!-->--> + <!--</j-multi-select-tag>--> + <!--</a-form-model-item>--> - <a-form-model-item label="鐢熸棩" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <a-date-picker - style="width: 100%" - placeholder="璇烽�夋嫨鐢熸棩" - v-model="model.birthday" - :format="dateFormat" - :getCalendarContainer="node => node.parentNode"/> - </a-form-model-item> + <!--<a-form-model-item--> + <!--label="澶村儚"--> + <!--:labelCol="labelCol"--> + <!--:wrapperCol="wrapperCol"--> + <!-->--> + <!--<j-image-upload--> + <!--class="avatar-uploader"--> + <!--text="涓婁紶"--> + <!--v-model="model.avatar"--> + <!--></j-image-upload>--> + <!--</a-form-model-item>--> - <a-form-model-item label="鎬у埆" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <a-select v-model="model.sex" placeholder="璇烽�夋嫨鎬у埆" :getPopupContainer= "(target) => target.parentNode"> - <a-select-option :value="1">鐢�</a-select-option> - <a-select-option :value="2">濂�</a-select-option> - </a-select> - </a-form-model-item> + <!--<a-form-model-item--> + <!--label="鐢熸棩"--> + <!--:labelCol="labelCol"--> + <!--:wrapperCol="wrapperCol"--> + <!-->--> + <!--<a-date-picker--> + <!--style="width: 100%"--> + <!--placeholder="璇烽�夋嫨鐢熸棩"--> + <!--v-model="model.birthday"--> + <!--:format="dateFormat"--> + <!--:getCalendarContainer="node => node.parentNode"--> + <!--/>--> + <!--</a-form-model-item>--> - <a-form-model-item label="閭" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="email"> - <a-input placeholder="璇疯緭鍏ラ偖绠�" v-model="model.email" /> - </a-form-model-item> + <!--<a-form-model-item--> + <!--label="鎬у埆"--> + <!--:labelCol="labelCol"--> + <!--:wrapperCol="wrapperCol"--> + <!-->--> + <!--<a-select--> + <!--v-model="model.sex"--> + <!--placeholder="璇烽�夋嫨鎬у埆"--> + <!--:getPopupContainer="(target) => target.parentNode"--> + <!-->--> + <!--<a-select-option :value="1">鐢�</a-select-option>--> + <!--<a-select-option :value="2">濂�</a-select-option>--> + <!--</a-select>--> + <!--</a-form-model-item>--> - <a-form-model-item label="搴ф満" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="telephone"> - <a-input placeholder="璇疯緭鍏ュ骇鏈�" v-model="model.telephone" /> - </a-form-model-item> + <!--<a-form-model-item--> + <!--label="閭"--> + <!--:labelCol="labelCol"--> + <!--:wrapperCol="wrapperCol"--> + <!--prop="email"--> + <!-->--> + <!--<a-input--> + <!--placeholder="璇疯緭鍏ラ偖绠�"--> + <!--v-model="model.email"--> + <!--/>--> + <!--</a-form-model-item>--> - <a-form-model-item label="宸ヤ綔娴佸紩鎿�" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <j-dict-select-tag v-model="model.activitiSync" placeholder="璇烽�夋嫨鏄惁鍚屾宸ヤ綔娴佸紩鎿�" :type="'radio'" dictCode="activiti_sync"/> - </a-form-model-item> + <!--<a-form-model-item--> + <!--label="鎵嬫満鍙风爜"--> + <!--:labelCol="labelCol"--> + <!--:wrapperCol="wrapperCol"--> + <!--prop="phone"--> + <!-->--> + <!--<a-input--> + <!--placeholder="璇疯緭鍏ユ墜鏈哄彿鐮�"--> + <!--v-model="model.phone"--> + <!--/>--> + <!--</a-form-model-item>--> + + <!--<a-form-model-item--> + <!--label="搴ф満"--> + <!--:labelCol="labelCol"--> + <!--:wrapperCol="wrapperCol"--> + <!--prop="telephone"--> + <!-->--> + <!--<a-input--> + <!--placeholder="璇疯緭鍏ュ骇鏈�"--> + <!--v-model="model.telephone"--> + <!--/>--> + <!--</a-form-model-item>--> + <!--<a-form-model-item label="宸ヤ綔娴佸紩鎿�" :labelCol="labelCol" :wrapperCol="wrapperCol">--> + <!--<j-dict-select-tag v-model="model.activitiSync" placeholder="璇烽�夋嫨鏄惁鍚屾宸ヤ綔娴佸紩鎿�" :type="'radio'" dictCode="activiti_sync"/>--> + <!--</a-form-model-item>--> </a-form-model> </a-spin> - - <div class="drawer-bootom-button" v-show="!disableSubmit"> - <a-popconfirm title="纭畾鏀惧純缂栬緫锛�" @confirm="handleCancel" okText="纭畾" cancelText="鍙栨秷"> + <div + class="drawer-bottom-button" + v-show="!disableSubmit" + > + <a-popconfirm + title="纭畾鏀惧純缂栬緫锛�" + @confirm="handleCancel" + okText="纭畾" + cancelText="鍙栨秷" + > <a-button style="margin-right: .8rem">鍙栨秷</a-button> </a-popconfirm> - <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">鎻愪氦</a-button> + <a-button + @click="handleSubmit" + type="primary" + :loading="confirmLoading" + >鎻愪氦 + </a-button> </div> + </a-drawer> </template> <script> import moment from 'moment' import Vue from 'vue' - import { ACCESS_TOKEN } from "@/store/mutation-types" + import { ACCESS_TOKEN } from '@/store/mutation-types' import { getAction } from '@/api/manage' - import { addUser,editUser,queryUserRole,queryall } from '@/api/api' - import { disabledAuthFilter } from "@/utils/authFilter" + import { addUser, editUser, queryUserRole, queryall } from '@/api/api' + import { disabledAuthFilter } from '@/utils/authFilter' import { duplicateCheck } from '@/api/api' + import JSelectProduction from '../../../components/jeecgbiz/JSelectProduction' + import { mapActions } from 'vuex' + import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api' export default { - name: "UserModal", + name: 'UserModal', components: { + JSelectProduction }, - data () { + data() { return { departDisabled: false, //鏄惁鏄垜鐨勯儴闂ㄨ皟鐢ㄨ椤甸潰 + productionDisabled: false, //鏄惁鏄垜鐨勮溅闂磋皟鐢ㄨ椤甸潰 roleDisabled: false, //鏄惁鏄鑹茬淮鎶よ皟鐢ㄨ椤甸潰 - modalWidth:800, - drawerWidth:700, - modaltoggleFlag:true, + modalWidth: 800, + drawerWidth: 700, + modaltoggleFlag: true, confirmDirty: false, - userId:"", //淇濆瓨鐢ㄦ埛id - disableSubmit:false, - dateFormat:"YYYY-MM-DD", - validatorRules:{ - username:[{required: true, message: '璇疯緭鍏ョ敤鎴疯处鍙�!'}, - {validator: this.validateUsername,}], - password: [{required: true,pattern:/^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/,message: '瀵嗙爜鐢�8浣嶆暟瀛椼�佸ぇ灏忓啓瀛楁瘝鍜岀壒娈婄鍙风粍鎴�!'}, - {validator: this.validateToNextPassword,trigger: 'change'}], - confirmpassword: [{required: true, message: '璇烽噸鏂拌緭鍏ョ櫥褰曞瘑鐮�!',}, - { validator: this.compareToFirstPassword,}], - realname:[{ required: true, message: '璇疯緭鍏ョ敤鎴峰悕绉�!' }], - phone: [{required: true, message: '璇疯緭鍏ユ墜鏈哄彿!'}, {validator: this.validatePhone}], - email: [{validator: this.validateEmail}], - roles:{}, - workNo:[ { required: true, message: '璇疯緭鍏ュ伐鍙�' }, + userId: '', //淇濆瓨鐢ㄦ埛id + disableSubmit: false, + dateFormat: 'YYYY-MM-DD', + validatorRules: { + username: [{ required: true, message: '璇疯緭鍏ョ敤鎴疯处鍙�!' }, + { validator: this.validateUsername }], + password: [{ + required: true, + pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/, + message: '瀵嗙爜鐢�8浣嶆暟瀛椼�佸ぇ灏忓啓瀛楁瘝鍜岀壒娈婄鍙风粍鎴�!' + }, + { validator: this.validateToNextPassword, trigger: 'change' }], + confirmpassword: [{ required: true, message: '璇烽噸鏂拌緭鍏ョ櫥褰曞瘑鐮�!' }, + { validator: this.compareToFirstPassword }], + realname: [{ required: true, message: '璇疯緭鍏ョ敤鎴峰悕绉�!' }], + phone: [{ required: false, message: '璇疯緭鍏ユ墜鏈哄彿!' }, { validator: this.validatePhone }], + email: [{ validator: this.validateEmail }], + roles: {}, + workNo: [{ required: true, message: '璇疯緭鍏ュ伐鍙�' }, { validator: this.validateWorkNo }], - telephone: [{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '璇疯緭鍏ユ纭殑搴ф満鍙风爜' },] + telephone: [{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '璇疯緭鍏ユ纭殑搴ф満鍙风爜' }], + teamId: [{ required: false, message: '璇风淮鎶ょ彮缁�' }] }, - departIdShow:false, - title:"鎿嶄綔", + departIdShow: false, + title: '鎿嶄綔', visible: false, model: {}, labelCol: { xs: { span: 24 }, - sm: { span: 5 }, + sm: { span: 5 } }, wrapperCol: { xs: { span: 24 }, - sm: { span: 16 }, + sm: { span: 16 } }, - uploadLoading:false, + uploadLoading: false, confirmLoading: false, - headers:{}, + headers: {}, url: { - fileUpload: window._CONFIG['domianURL']+"/sys/common/upload", - userWithDepart: "/sys/user/userDepartList", // 寮曞叆涓烘寚瀹氱敤鎴锋煡鐪嬮儴闂ㄤ俊鎭渶瑕佺殑url - userId:"/sys/user/generateUserId", // 寮曞叆鐢熸垚娣诲姞鐢ㄦ埛鎯呭喌涓嬬殑url - syncUserByUserName:"/act/process/extActProcess/doSyncUserByUserName",//鍚屾鐢ㄦ埛鍒板伐浣滄祦 + fileUpload: window._CONFIG['domianURL'] + 'sys/common/upload', + userWithDepart: '/sys/user/userDepartList', // 寮曞叆涓烘寚瀹氱敤鎴锋煡鐪嬮儴闂ㄤ俊鎭渶瑕佺殑url + //寮曞叆涓烘寚瀹氱敤鎴锋煡鐪嬭溅闂翠俊鎭渶瑕佺殑url + userProductionList: '/sys/user/userProductionList', + userId: '/sys/user/generateUserId', // 寮曞叆鐢熸垚娣诲姞鐢ㄦ埛鎯呭喌涓嬬殑url + syncUserByUserName: '/act/process/extActProcess/doSyncUserByUserName',//鍚屾鐢ㄦ埛鍒板伐浣滄祦 queryTenantList: '/sys/tenant/queryList' }, tenantsOptions: [], - rolesOptions:[], - nextDepartOptions:[], + rolesOptions: [], + nextDepartOptions: [], + nextProductionOptions: [], + isDepartType: '', + model: { + selectedProduction: '' + } } }, - created () { - const token = Vue.ls.get(ACCESS_TOKEN); - this.headers = {"X-Access-Token":token} + watch: { + visible: { + handler(value) { + if (value) this.initDictData('password_length') + } + }, + 'model.selectedProduction': { + handler(newVal, oldVal) { + if (newVal && this.$refs.selectDeviceModal) { + // 濡傛灉杞﹂棿閫夋嫨鍓嶅悗涓嶄竴鑷村垯閲嶇疆閫夋嫨璁惧 + if ((oldVal && newVal !== oldVal)) this.model.equipmentIds = '' + this.$refs.selectDeviceModal.queryTreeData(newVal) + } + // 濡傛灉娓呯┖杞﹂棿鍊煎垯閲嶇疆閫夋嫨璁惧 + if (newVal === '') this.model.equipmentIds = '' + } + } + }, + created() { + const token = Vue.ls.get(ACCESS_TOKEN) + this.headers = { 'X-Access-Token': token } this.initRoleList() this.initTenantList() + this.queryTreeData() }, - computed:{ - uploadAction:function () { - return this.url.fileUpload; + computed: { + uploadAction: function () { + return this.url.fileUpload } }, methods: { - add () { - this.refresh(); - this.edit({activitiSync:'1',userIdentity:1}); + ...mapActions(['QueryDepartTree']), + queryTreeData() { + this.QueryDepartTree().then(res => { + if (res.success) { + this.isDepartType = res.result[0].value + } else { + // this.$message.warn(res.message) + this.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + }) }, - edit (record) { - let that = this; - that.visible = true; + add() { + this.refresh() + this.edit({ + activitiSync: '1', + userType: 0, + userIdentity: 1, + selectedroles: '', + selecteddeparts: '', + selectedProduction: '' + }) + }, + edit(record) { + let that = this + that.visible = true //鏍规嵁灞忓箷瀹藉害鑷�傚簲鎶藉眽瀹藉害 - this.resetScreenSize(); - that.userId = record.id; - that.model = Object.assign({},{selectedroles:'',selecteddeparts:''}, record); + this.resetScreenSize() + that.userId = record.id + console.log('record', record) + that.model = Object.assign({}, record) //韬唤涓轰笂绾ф樉绀鸿礋璐i儴闂紝鍚﹀垯涓嶆樉绀� - if(this.model.userIdentity==2){ - this.departIdShow=true; - }else{ - this.departIdShow=false; + if (this.model.userIdentity == 2) { + this.departIdShow = true + } else { + this.departIdShow = false } - if(record.hasOwnProperty("id")){ - that.getUserRoles(record.id); - that.getUserDeparts(record.id); + if (record.hasOwnProperty('id')) { + that.getUserRoles(record.id) + that.getUserDeparts(record.id) } - console.log('that.model=',that.model) }, - isDisabledAuth(code){ - return disabledAuthFilter(code); + isDisabledAuth(code) { + return disabledAuthFilter(code) }, //绐楀彛鏈�澶у寲鍒囨崲 - toggleScreen(){ - if(this.modaltoggleFlag){ - this.modalWidth = window.innerWidth; - }else{ - this.modalWidth = 800; + toggleScreen() { + if (this.modaltoggleFlag) { + this.modalWidth = window.innerWidth + } else { + this.modalWidth = 800 } - this.modaltoggleFlag = !this.modaltoggleFlag; + this.modaltoggleFlag = !this.modaltoggleFlag }, // 鏍规嵁灞忓箷鍙樺寲,璁剧疆鎶藉眽灏哄 - resetScreenSize(){ - let screenWidth = document.body.clientWidth; - if(screenWidth < 500){ - this.drawerWidth = screenWidth; - }else{ - this.drawerWidth = 700; + resetScreenSize() { + let screenWidth = document.body.clientWidth + if (screenWidth < 500) { + this.drawerWidth = screenWidth + } else { + this.drawerWidth = 700 } }, //鍒濆鍖栫鎴峰瓧鍏� - initTenantList(){ - getAction(this.url.queryTenantList).then(res=>{ - if(res.success){ - this.tenantsOptions = res.result.map((item,index,arr)=>{ - let c = {label:item.name, value: item.id+""} - return c; + initTenantList() { + getAction(this.url.queryTenantList).then(res => { + if (res.success) { + this.tenantsOptions = res.result.map((item, index, arr) => { + let c = { label: item.name, value: item.id + '' } + return c }) - console.log('this.tenantsOptions: ',this.tenantsOptions) } }) }, //鍒濆鍖栬鑹插瓧鍏� - initRoleList(){ - queryall().then((res)=>{ - if(res.success){ - this.rolesOptions = res.result.map((item,index,arr)=>{ - let c = {label:item.roleName, value:item.id} - return c; + initRoleList() { + queryall().then((res) => { + if (res.success) { + this.rolesOptions = res.result.map((item, index, arr) => { + let c = { label: item.roleName, value: item.id } + return c }) - console.log('this.rolesOptions: ',this.rolesOptions) } - }); + }) }, - getUserRoles(userid){ - queryUserRole({userid:userid}).then((res)=>{ - if(res.success){ - this.model.selectedroles = res.result.join(","); - console.log('that.model.selectedroles=',this.model.selectedroles) + getUserRoles(userid) { + queryUserRole({ userid: userid }).then((res) => { + if (res.success) { + this.$set(this.model, 'selectedroles', res.result.join(',')) } - }); + }) }, - getUserDeparts(userid){ - let that = this; - getAction(that.url.userWithDepart,{userId:userid}).then((res)=>{ - if(res.success){ - let departOptions=[]; - let selectDepartKeys=[] + getUserDeparts(userid) { + let that = this + //閮ㄩ棬鐨剈rl 鑾峰彇閮ㄩ棬鍒嗛厤 + getAction(that.url.userWithDepart, { userId: userid }).then((res) => { + if (res.success) { + let departOptions = [] + let selectDepartKeys = [] for (let i = 0; i < res.result.length; i++) { - selectDepartKeys.push(res.result[i].key); + selectDepartKeys.push(res.result[i].key) //鏂板璐熻矗閮ㄩ棬閫夋嫨涓嬫媺妗� departOptions.push({ value: res.result[i].key, label: res.result[i].title }) } - that.model.selecteddeparts = selectDepartKeys.join(",") - that.nextDepartOptions=departOptions; - console.log('that.nextDepartOptions=',that.nextDepartOptions) + + this.$set(this.model, 'selecteddeparts', selectDepartKeys.join(',')) + that.nextDepartOptions = departOptions } }) + + // 鑾峰彇杞﹂棿鍒嗛厤 + getAction(that.url.userProductionList, { userId: userid }).then((res) => { + if (res.success) { + let ProductionOptions = [] + let selectProductKeys = [] + for (let i = 0; i < res.result.length; i++) { + selectProductKeys.push(res.result[i].key) + //鏂板璐熻矗閮ㄩ棬閫夋嫨涓嬫媺妗� + ProductionOptions.push({ + value: res.result[i].key, + label: res.result[i].title + }) + } + + this.$set(this.model, 'selectedProduction', selectProductKeys.join(',')) + that.nextProductionOptions = ProductionOptions + } + }) + //杞﹂棿鐨剈rl }, backDepartInfo(info) { - this.model.departIds = this.model.selecteddeparts; - this.nextDepartOptions = info.map((item,index,arr)=>{ - let c = {label:item.text, value: item.value+""} - return c; + this.model.departIds = this.model.selecteddeparts + this.nextDepartOptions = info.map((item, index, arr) => { + let c = { label: item.text, value: item.value + '' } + return c }) }, - refresh () { - this.userId="" - this.nextDepartOptions=[]; - this.departIdShow=false; + backProductionInfo(info) { + this.model.productionIds = this.model.selectedProduction + this.nextProductionOptions = info.map((item, index, arr) => { + let c = { label: item.text, value: item.value + '' } + return c + }) }, - close () { - this.$emit('close'); - this.visible = false; - this.disableSubmit = false; - this.nextDepartOptions=[]; - this.departIdShow=false; - this.$refs.form.resetFields(); + + refresh() { + this.userId = '' + this.nextDepartOptions = [] + this.nextProductionOptions = [] + this.departIdShow = false + }, + close() { + this.$emit('close') + this.visible = false + this.disableSubmit = false + this.nextDepartOptions = [] + this.nextProductionOptions = [] + this.departIdShow = false + this.$refs.form.resetFields() }, moment, - handleSubmit () { - const that = this; + handleSubmit() { + const that = this // 瑙﹀彂琛ㄥ崟楠岃瘉 this.$refs.form.validate(valid => { if (valid) { - that.confirmLoading = true; + that.confirmLoading = true //濡傛灉鏄笂绾ф嫨浼犲叆departIds,鍚﹀垯涓虹┖ - if(this.model.userIdentity!==2){ - this.model.departIds=""; + if (this.model.userIdentity !== 2) { + this.model.departIds = '' } - let obj; - if(!this.model.id){ - this.model.id = this.userId; - obj=addUser(this.model); - }else{ - obj=editUser(this.model); + let obj + if (!this.model.id) { + this.model.id = this.userId + obj = addUser(this.model) + } else { + obj = editUser(this.model) } - obj.then((res)=>{ - if(res.success){ - that.$message.success(res.message); - that.$emit('ok'); - }else{ - that.$message.warning(res.message); + obj.then((res) => { + if (res.success) { + that.$message.success(res.message) + that.$emit('ok') + } else { + that.$message.warning(res.message) } }).finally(() => { - that.confirmLoading = false; - that.close(); + that.confirmLoading = false + that.close() }) - }else{ - return false; + } else { + return false } }) }, - handleCancel () { + handleCancel() { this.close() }, - validateToNextPassword (rule, value, callback) { - const confirmpassword=this.model.confirmpassword; + validateToNextPassword(rule, value, callback) { + const confirmpassword = this.model.confirmpassword if (value && confirmpassword && value !== confirmpassword) { - callback('涓ゆ杈撳叆鐨勫瘑鐮佷笉涓�鏍凤紒'); + callback('涓ゆ杈撳叆鐨勫瘑鐮佷笉涓�鏍凤紒') } if (value && this.confirmDirty) { - this.$refs.form.validateField(['confirmpassword']); + this.$refs.form.validateField(['confirmpassword']) } - callback(); + callback() }, - compareToFirstPassword (rule, value, callback) { + compareToFirstPassword(rule, value, callback) { if (value && value !== this.model.password) { - callback('涓ゆ杈撳叆鐨勫瘑鐮佷笉涓�鏍凤紒'); + callback('涓ゆ杈撳叆鐨勫瘑鐮佷笉涓�鏍凤紒') } else { callback() } }, - validatePhone(rule, value, callback){ - if(!value){ + validatePhone(rule, value, callback) { + if (!value) { callback() - }else{ - if(new RegExp(/^1[3|4|5|6|7|8|9][0-9]\d{8}$/).test(value)){ + } else { + if (new RegExp(/^1[3|4|5|7|8|9][0-9]\d{8}$/).test(value)) { var params = { tableName: 'sys_user', fieldName: 'phone', fieldVal: value, dataId: this.userId - }; + } duplicateCheck(params).then((res) => { if (res.success) { callback() } else { - callback("鎵嬫満鍙峰凡瀛樺湪!") + callback('鎵嬫満鍙峰凡瀛樺湪!') } }) - }else{ - callback("璇疯緭鍏ユ纭牸寮忕殑鎵嬫満鍙风爜!"); + } else { + callback('璇疯緭鍏ユ纭牸寮忕殑鎵嬫満鍙风爜!') } } }, - validateEmail(rule, value, callback){ - if(!value){ + validateEmail(rule, value, callback) { + if (!value) { callback() - }else{ - if(new RegExp(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/).test(value)){ + } else { + if (new RegExp(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/).test(value)) { var params = { tableName: 'sys_user', fieldName: 'email', fieldVal: value, dataId: this.userId - }; + } duplicateCheck(params).then((res) => { console.log(res) if (res.success) { callback() } else { - callback("閭宸插瓨鍦�!") + callback('閭宸插瓨鍦�!') } }) - }else{ - callback("璇疯緭鍏ユ纭牸寮忕殑閭!") + } else { + callback('璇疯緭鍏ユ纭牸寮忕殑閭!') } } }, - validateUsername(rule, value, callback){ + validateUsername(rule, value, callback) { var params = { tableName: 'sys_user', fieldName: 'username', fieldVal: value, dataId: this.userId - }; + } duplicateCheck(params).then((res) => { if (res.success) { callback() } else { - callback("鐢ㄦ埛鍚嶅凡瀛樺湪!") + callback('鐢ㄦ埛鍚嶅凡瀛樺湪!') } }) }, - validateWorkNo(rule, value, callback){ + validateWorkNo(rule, value, callback) { var params = { tableName: 'sys_user', fieldName: 'work_no', fieldVal: value, dataId: this.userId - }; + } duplicateCheck(params).then((res) => { if (res.success) { callback() } else { - callback("宸ュ彿宸插瓨鍦�!") + callback('宸ュ彿宸插瓨鍦�!') } }) }, handleConfirmBlur(e) { - const value = e.target.value; + const value = e.target.value this.confirmDirty = this.confirmDirty || !!value }, - beforeUpload: function(file){ - var fileType = file.type; - if(fileType.indexOf('image')<0){ - this.$message.warning('璇蜂笂浼犲浘鐗�'); - return false; + beforeUpload: function (file) { + var fileType = file.type + if (fileType.indexOf('image') < 0) { + this.$message.warning('璇蜂笂浼犲浘鐗�') + return false } //TODO 楠岃瘉鏂囦欢澶у皬 }, - identityChange(e){ - if(e.target.value===1){ - this.departIdShow=false; - }else{ - this.departIdShow=true; + identityChange(e) { + if (e.target.value === 1) { + this.departIdShow = false + } else { + this.departIdShow = true } + }, + initDictData(dictCode) { + //鏍规嵁瀛楀吀Code, 鍒濆鍖栧瓧鍏告暟缁� + ajaxGetDictItems(dictCode, null).then((res) => { + if (res.success) { + const regExp = new RegExp('^(?=.*[a-zA-Z])(?=.*\\\d)(?=.*[~!@#$%^&*()_+`\\-={}:";\'<>?,./]).{' + Number(res.result[0].value) + ',}$') + + this.validatorRules.password[0] = { + required: true, + pattern: regExp, + message: `瀵嗙爜鐢�${res.result[0].value}浣嶆暟瀛椼�佸ぇ灏忓啓瀛楁瘝鍜岀壒娈婄鍙风粍鎴�!` + } + + } + }) + }, + + deviceSearch() { + this.$refs.selectDeviceModal.visible = true + this.$refs.selectDeviceModal.selectedRowKeys = [] + this.$refs.selectDeviceModal.selectedRows = [] + this.$refs.selectDeviceModal.checkedKeys = this.model.equipmentIds ? this.model.equipmentIds.split(',') : [] + }, + + /** + * 閫夋嫨宸叉湁璁惧鍚庣偣鍑荤‘瀹氭椂瑙﹀彂 + * @param data 宸查�夋嫨鐨勮澶囨暟缁� + */ + selectOK(data) { + console.log('data=', data) + this.$set(this.model, 'equipmentIds', data.join(',')) } } } @@ -487,9 +805,10 @@ <style scoped> .avatar-uploader > .ant-upload { - width:104px; - height:104px; + width: 104px; + height: 104px; } + .ant-upload-select-picture-card i { font-size: 49px; color: #999; @@ -500,14 +819,14 @@ color: #666; } - .ant-table-tbody .ant-table-row td{ - padding-top:10px; - padding-bottom:10px; + .ant-table-tbody .ant-table-row td { + padding-top: 10px; + padding-bottom: 10px; } - .drawer-bootom-button { + .drawer-bottom-button { position: absolute; - bottom: 0; + bottom: -8px; width: 100%; border-top: 1px solid #e8e8e8; padding: 10px 16px; @@ -516,10 +835,4 @@ background: #fff; border-radius: 0 0 2px 2px; } - - /*銆怞TC-502銆� 娣诲姞鐢ㄦ埛涓や釜婊氬姩鏉�*/ - /deep/ .ant-drawer-body { - padding-bottom: 53px; - } - -</style> +</style> \ No newline at end of file diff --git a/src/views/system/modules/UserRecycleBinModal.vue b/src/views/system/modules/UserRecycleBinModal.vue index 0e04220..c7f991f 100644 --- a/src/views/system/modules/UserRecycleBinModal.vue +++ b/src/views/system/modules/UserRecycleBinModal.vue @@ -92,7 +92,8 @@ { title: '璐﹀彿', align: 'center', dataIndex: 'username' }, { title: '濮撳悕', align: 'center', dataIndex: 'realname', }, { title: '澶村儚', align: 'center', dataIndex: 'avatar', scopedSlots: { customRender: 'avatarslot' } }, - { title: '閮ㄩ棬', align: 'center', dataIndex: 'orgCode' }, + // { title: '閮ㄩ棬', align: 'center', dataIndex: 'orgCode' }, + { title: '杞﹂棿', align: 'center', dataIndex: 'productionName' }, { title: '鎿嶄綔', align: 'center', dataIndex: 'action', width: 200, scopedSlots: { customRender: 'action' } } ], url: { @@ -144,7 +145,11 @@ if(res.success){ this.handleOk() this.handleClearSelection() - this.$message.success(`杩樺師 ${userIds.length} 涓敤鎴锋垚鍔燂紒`) + // this.$message.success(`杩樺師 ${userIds.length} 涓敤鎴锋垚鍔燂紒`) + this.$notification.success({ + message:'娑堟伅', + description:`杩樺師 ${userIds.length} 涓敤鎴锋垚鍔燂紒` + }); } }) } @@ -156,22 +161,28 @@ title: '褰诲簳鍒犻櫎鐢ㄦ埛', content: (<div> <p>鎮ㄧ‘瀹氳褰诲簳鍒犻櫎杩� {userIds.length} 涓敤鎴峰悧锛�</p> - <p style="color:red;">娉ㄦ剰锛氬交搴曞垹闄ゅ悗灏嗘棤娉曟仮澶嶏紝璇疯皑鎱庢搷浣滐紒</p> - </div>), - centered: true, + <p style="color:red;">娉ㄦ剰锛氬交搴曞垹闄ゅ悗灏嗘棤娉曟仮澶嶏紝璇疯皑鎱庢搷浣滐紒</p> + </div>), + centered: true, onOk: () => { - var that = this; - deleteAction(that.url.deleteRecycleBin, {userIds: userIds.join(',')}).then((res) => { - if (res.success) { - this.loadData() - this.handleClearSelection() - this.$message.success(`褰诲簳鍒犻櫎 ${userIds.length} 涓敤鎴锋垚鍔燂紒`) - } else { - that.$message.warning(res.message); - } - }); - }, - }) + var that = this; + deleteAction(that.url.deleteRecycleBin, {userIds: userIds.join(',')}).then((res) => { + if (res.success) { + this.loadData() + this.handleClearSelection() + that.$notification.success({ + message:'娑堟伅', + description:`褰诲簳鍒犻櫎 ${userIds.length} 涓敤鎴锋垚鍔燂紒` + }); + } else { + that.$notification.warning({ + message:'娑堟伅', + description:res.message + }); + } + }); + }, + }) }, handleRevertBatch() { this.handleRevert(this.selectedRowKeys) -- Gitblit v1.9.3