parent
4383ffaf27
commit
5ba510eabb
|
After Width: | Height: | Size: 24 KiB |
@ -1,183 +1,187 @@
|
||||
<template>
|
||||
<div>
|
||||
<lx-header icon="md-apps" style="margin-bottom: 10px; border: 0px; margin-top: 15px" text="项目用户管理">
|
||||
<div slot="content"></div>
|
||||
<slot>
|
||||
<div class="selects">
|
||||
<div style="display: flex;align-items: center;" v-show="!sysInfo">
|
||||
<span style="padding: 0 6px;word-break: keep-all;">
|
||||
项目
|
||||
</span>
|
||||
<Select v-model="select.activity_list_id" style="width: 180px;">
|
||||
<Option v-for="(item,index) of listActivity" :key="item.id" :value="item.id" :label="item.name">
|
||||
</Option>
|
||||
</Select>
|
||||
</div>
|
||||
<div>
|
||||
<span style="padding: 0 6px;word-break: keep-all;">
|
||||
关键字
|
||||
</span>
|
||||
<Input v-model="select.keyword" placeholder="请输入关键字" style="width: 180px"></Input>
|
||||
</div>
|
||||
|
||||
<Button style="margin-left: 10px" type="primary" @click="select={page:1,keyword:''}">重置
|
||||
</Button>
|
||||
<Button style="margin-left: 10px" type="primary" @click="doSearch">查询</Button>
|
||||
<Button style="margin-left: 10px" type="primary" @click="add">新增</Button>
|
||||
</div>
|
||||
</slot>
|
||||
</lx-header>
|
||||
|
||||
|
||||
<xy-table :list="list" :total="total" :table-item="table" @delete="deleteitem"
|
||||
@editor="(row)=>{$refs['addActivityUser'].id = row.id;$refs['addActivityUser'].isShow = true;$refs['addActivityUser'].type = 'editor'}"
|
||||
@pageSizeChange="e => {select.page_size = e;doSearch()}" @pageIndexChange="pageChange"
|
||||
:pageSize="select.page_size">
|
||||
<template v-slot:btns v-if="type==0 ">
|
||||
|
||||
</template>
|
||||
</xy-table>
|
||||
<addActivityUser ref="addActivityUser" :listActivity="listActivity" @refresh="load()"></addActivityUser>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
index,
|
||||
destroy,
|
||||
show
|
||||
} from "@/api/activity/activityUser";
|
||||
import {
|
||||
index as activityIndex
|
||||
} from "@/api/activity/index";
|
||||
|
||||
|
||||
import addActivityUser from '@/views/activity/components/addActivityUser'
|
||||
export default {
|
||||
components: {
|
||||
addActivityUser
|
||||
},
|
||||
data() {
|
||||
<template>
|
||||
<div>
|
||||
<lx-header icon="md-apps" style="margin-bottom: 10px; border: 0px; margin-top: 15px" text="项目用户管理">
|
||||
<div slot="content"></div>
|
||||
<slot>
|
||||
<div class="selects">
|
||||
<div style="display: flex;align-items: center;" v-show="!sysInfo">
|
||||
<span style="padding: 0 6px;word-break: keep-all;">
|
||||
项目
|
||||
</span>
|
||||
<Select v-model="select.activity_list_id" style="width: 180px;">
|
||||
<Option v-for="(item,index) of listActivity" :key="item.id" :value="item.id" :label="item.name">
|
||||
</Option>
|
||||
</Select>
|
||||
</div>
|
||||
<div>
|
||||
<span style="padding: 0 6px;word-break: keep-all;">
|
||||
关键字
|
||||
</span>
|
||||
<Input v-model="select.keyword" placeholder="请输入关键字" style="width: 180px"></Input>
|
||||
</div>
|
||||
|
||||
<Button style="margin-left: 10px" type="primary" @click="select={page:1,keyword:''}">重置
|
||||
</Button>
|
||||
<Button style="margin-left: 10px" type="primary" @click="doSearch">查询</Button>
|
||||
<Button style="margin-left: 10px" type="primary" @click="add">新增</Button>
|
||||
</div>
|
||||
</slot>
|
||||
</lx-header>
|
||||
|
||||
|
||||
<xy-table :list="list" :total="total" :table-item="table" @delete="deleteitem"
|
||||
@editor="(row)=>{$refs['addActivityUser'].id = row.id;$refs['addActivityUser'].isShow = true;$refs['addActivityUser'].type = 'editor'}"
|
||||
@pageSizeChange="e => {select.page_size = e;doSearch()}" @pageIndexChange="pageChange"
|
||||
:pageSize="select.page_size">
|
||||
<template v-slot:btns v-if="type==0 ">
|
||||
|
||||
</template>
|
||||
</xy-table>
|
||||
<addActivityUser ref="addActivityUser" :listActivity="listActivity" @refresh="load()"></addActivityUser>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
index,
|
||||
destroy,
|
||||
show
|
||||
} from "@/api/activity/activityUser";
|
||||
import {
|
||||
index as activityIndex
|
||||
} from "@/api/activity/index";
|
||||
|
||||
|
||||
import addActivityUser from '@/views/activity/components/addActivityUser'
|
||||
export default {
|
||||
components: {
|
||||
addActivityUser
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sysInfo:null,
|
||||
select: {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
keyword: '',
|
||||
activity_list_id: ""
|
||||
},
|
||||
listActivity: [],
|
||||
total: 0,
|
||||
list: [],
|
||||
table: [{
|
||||
prop: 'activity_list.name',
|
||||
label: '项目名称',
|
||||
fixed: 'left',
|
||||
align: 'left'
|
||||
}, {
|
||||
prop: 'name',
|
||||
label: '用户名称',
|
||||
align: 'left',
|
||||
|
||||
|
||||
}, {
|
||||
prop: 'top_department_id',
|
||||
label: '排名',
|
||||
align: 'center',
|
||||
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
prop: 'company_name',
|
||||
label: '所属部门/分公司',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'username',
|
||||
label: '登录账号',
|
||||
align: 'center'
|
||||
}, {
|
||||
prop: 'mobile',
|
||||
label: '手机号',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'created_at',
|
||||
label: '创建信息',
|
||||
width: 190,
|
||||
formatter: (v1, v2, value) => {
|
||||
return this.$moment(value).format("YYYY-MM-DD HH:mm:ss");
|
||||
}
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
async loadActivity() {
|
||||
const res = await activityIndex({
|
||||
page: 1,
|
||||
page_size: 999
|
||||
})
|
||||
this.listActivity = res.data;
|
||||
},
|
||||
doSearch() {
|
||||
this.select.page = 1;
|
||||
this.load();
|
||||
},
|
||||
add() {
|
||||
this.$refs['addActivityUser'].isShow = true
|
||||
},
|
||||
pageSizeChange(e) {
|
||||
this.select.page_size = e;
|
||||
this.select.page = 1;
|
||||
this.load();
|
||||
},
|
||||
async load() {
|
||||
const res = await index(this.select)
|
||||
this.total = res.total
|
||||
this.list = res.data
|
||||
},
|
||||
deleteitem(row) {
|
||||
destroy({
|
||||
id: row.id
|
||||
}).then(res => {
|
||||
this.load();
|
||||
this.$Message.success("操作成功");
|
||||
})
|
||||
},
|
||||
pageChange(e) {
|
||||
this.select.page = e
|
||||
this.load()
|
||||
},
|
||||
},
|
||||
created() {
|
||||
let that = this;
|
||||
let type = parseInt(this.$route.path.split("_")[1]);
|
||||
this.type = this.select.is_auth = type;
|
||||
let sysInfo = sessionStorage.getItem('sys_info')
|
||||
if (sysInfo && sysInfo != "") {
|
||||
sysInfo:null,
|
||||
select: {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
keyword: '',
|
||||
activity_list_id: ""
|
||||
},
|
||||
listActivity: [],
|
||||
total: 0,
|
||||
list: [],
|
||||
table: [{
|
||||
prop: 'activity_list.name',
|
||||
label: '项目名称',
|
||||
fixed: 'left',
|
||||
align: 'left'
|
||||
}, {
|
||||
prop: 'name',
|
||||
label: '用户名称',
|
||||
align: 'left',
|
||||
customFn: row => {
|
||||
return (
|
||||
<span>{ row.name ? row.name : (row.nickname ? JSON.parse(row.nickname) : '')}</span>
|
||||
)
|
||||
}
|
||||
|
||||
}, {
|
||||
prop: 'top_department_id',
|
||||
label: '排名',
|
||||
align: 'center',
|
||||
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
prop: 'company_name',
|
||||
label: '所属部门/分公司',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'username',
|
||||
label: '登录账号',
|
||||
align: 'center'
|
||||
}, {
|
||||
prop: 'mobile',
|
||||
label: '手机号',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'created_at',
|
||||
label: '创建信息',
|
||||
width: 190,
|
||||
formatter: (v1, v2, value) => {
|
||||
return this.$moment(value).format("YYYY-MM-DD HH:mm:ss");
|
||||
}
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
async loadActivity() {
|
||||
const res = await activityIndex({
|
||||
page: 1,
|
||||
page_size: 999
|
||||
})
|
||||
this.listActivity = res.data;
|
||||
},
|
||||
doSearch() {
|
||||
this.select.page = 1;
|
||||
this.load();
|
||||
},
|
||||
add() {
|
||||
this.$refs['addActivityUser'].isShow = true
|
||||
},
|
||||
pageSizeChange(e) {
|
||||
this.select.page_size = e;
|
||||
this.select.page = 1;
|
||||
this.load();
|
||||
},
|
||||
async load() {
|
||||
const res = await index(this.select)
|
||||
this.total = res.total
|
||||
this.list = res.data
|
||||
},
|
||||
deleteitem(row) {
|
||||
destroy({
|
||||
id: row.id
|
||||
}).then(res => {
|
||||
this.load();
|
||||
this.$Message.success("操作成功");
|
||||
})
|
||||
},
|
||||
pageChange(e) {
|
||||
this.select.page = e
|
||||
this.load()
|
||||
},
|
||||
},
|
||||
created() {
|
||||
let that = this;
|
||||
let type = parseInt(this.$route.path.split("_")[1]);
|
||||
this.type = this.select.is_auth = type;
|
||||
let sysInfo = sessionStorage.getItem('sys_info')
|
||||
if (sysInfo && sysInfo != "") {
|
||||
let _sys = JSON.parse(sysInfo);
|
||||
if(_sys.tag!='h5'){
|
||||
that.select.activity_list_id = _sys.id;
|
||||
that.sysInfo=_sys;
|
||||
}
|
||||
|
||||
}
|
||||
this.load();
|
||||
this.loadActivity()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.selects {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
&>div {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
this.load();
|
||||
this.loadActivity()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.selects {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
&>div {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,148 +1,148 @@
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
const defaultSettings = require('./src/settings.js')
|
||||
|
||||
function resolve(dir) {
|
||||
return path.join(__dirname, dir)
|
||||
}
|
||||
|
||||
const name = defaultSettings.title // page title
|
||||
|
||||
// If your port is set to 80,
|
||||
// use administrator privileges to execute the command line.
|
||||
// For example, Mac: sudo npm run
|
||||
// You can change the port by the following methods:
|
||||
// port = 9528 npm run dev OR npm run dev --port = 9528
|
||||
const port = process.env.port || process.env.npm_config_port || 8013 // dev port
|
||||
|
||||
// All configuration item explanations can be find in https://cli.vuejs.org/config/
|
||||
module.exports = {
|
||||
/**
|
||||
* You will need to set publicPath if you plan to deploy your site under a sub path,
|
||||
* for example GitHub Pages. If you plan to deploy your site to https://foo.github.io/bar/,
|
||||
* then publicPath should be set to "/bar/".
|
||||
* In most cases please use '/' !!!
|
||||
* Detail: https://cli.vuejs.org/config/#publicpath
|
||||
*/
|
||||
publicPath: '/admin/',
|
||||
outputDir: '/Users/mac/Documents/朗业/0-朗业基础库/h5/public/admin',
|
||||
assetsDir: 'static',
|
||||
css: {
|
||||
loaderOptions: { // 向 CSS 相关的 loader 传递选项
|
||||
less: {
|
||||
javascriptEnabled: true
|
||||
}
|
||||
}
|
||||
},
|
||||
lintOnSave: process.env.NODE_ENV === 'development',
|
||||
productionSourceMap: false,
|
||||
devServer: {
|
||||
port: port,
|
||||
open: true,
|
||||
overlay: {
|
||||
warnings: false,
|
||||
errors: true
|
||||
},
|
||||
//before: require('./mock/mock-server.js'),
|
||||
proxy: {
|
||||
[process.env.VUE_APP_BASE_API]: {
|
||||
target: process.env.VUE_APP_BASE_API,
|
||||
changeOrigin: true, //配置跨域
|
||||
pathRewrite: {
|
||||
['^' + process.env.VUE_APP_BASE_API]: process.env.VUE_APP_BASE_API
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
configureWebpack: {
|
||||
// provide the app's title in webpack's name field, so that
|
||||
// it can be accessed in index.html to inject the correct title.
|
||||
name: name,
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': resolve('src')
|
||||
}
|
||||
}
|
||||
},
|
||||
chainWebpack(config) {
|
||||
// it can improve the speed of the first screen, it is recommended to turn on preload
|
||||
config.plugin('preload').tap(() => [{
|
||||
rel: 'preload',
|
||||
// to ignore runtime.js
|
||||
// https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/config/app.js#L171
|
||||
fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/],
|
||||
include: 'initial'
|
||||
}])
|
||||
|
||||
// when there are many pages, it will cause too many meaningless requests
|
||||
config.plugins.delete('prefetch')
|
||||
|
||||
// set svg-sprite-loader
|
||||
config.module
|
||||
.rule('svg')
|
||||
.exclude.add(resolve('src/icons'))
|
||||
.end()
|
||||
config.module
|
||||
.rule('icons')
|
||||
.test(/\.svg$/)
|
||||
.include.add(resolve('src/icons'))
|
||||
.end()
|
||||
.use('svg-sprite-loader')
|
||||
.loader('svg-sprite-loader')
|
||||
.options({
|
||||
symbolId: 'icon-[name]'
|
||||
})
|
||||
.end()
|
||||
|
||||
// set preserveWhitespace
|
||||
config.module
|
||||
.rule('vue')
|
||||
.use('vue-loader')
|
||||
.loader('vue-loader')
|
||||
.tap(options => {
|
||||
options.compilerOptions.preserveWhitespace = true
|
||||
return options
|
||||
})
|
||||
.end()
|
||||
|
||||
config
|
||||
.when(process.env.NODE_ENV !== 'development',
|
||||
config => {
|
||||
config
|
||||
.plugin('ScriptExtHtmlWebpackPlugin')
|
||||
.after('html')
|
||||
.use('script-ext-html-webpack-plugin', [{
|
||||
// `runtime` must same as runtimeChunk name. default is `runtime`
|
||||
inline: /runtime\..*\.js$/
|
||||
}])
|
||||
.end()
|
||||
config
|
||||
.optimization.splitChunks({
|
||||
chunks: 'all',
|
||||
cacheGroups: {
|
||||
libs: {
|
||||
name: 'chunk-libs',
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
priority: 10,
|
||||
chunks: 'initial' // only package third parties that are initially dependent
|
||||
},
|
||||
elementUI: {
|
||||
name: 'chunk-elementUI', // split elementUI into a single package
|
||||
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
|
||||
test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
|
||||
},
|
||||
commons: {
|
||||
name: 'chunk-commons',
|
||||
test: resolve('src/components'), // can customize your rules
|
||||
minChunks: 3, // minimum common number
|
||||
priority: 5,
|
||||
reuseExistingChunk: true
|
||||
}
|
||||
}
|
||||
})
|
||||
// https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk
|
||||
config.optimization.runtimeChunk('single')
|
||||
}
|
||||
)
|
||||
}
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
const defaultSettings = require('./src/settings.js')
|
||||
|
||||
function resolve(dir) {
|
||||
return path.join(__dirname, dir)
|
||||
}
|
||||
|
||||
const name = defaultSettings.title // page title
|
||||
|
||||
// If your port is set to 80,
|
||||
// use administrator privileges to execute the command line.
|
||||
// For example, Mac: sudo npm run
|
||||
// You can change the port by the following methods:
|
||||
// port = 9528 npm run dev OR npm run dev --port = 9528
|
||||
const port = process.env.port || process.env.npm_config_port || 8013 // dev port
|
||||
|
||||
// All configuration item explanations can be find in https://cli.vuejs.org/config/
|
||||
module.exports = {
|
||||
/**
|
||||
* You will need to set publicPath if you plan to deploy your site under a sub path,
|
||||
* for example GitHub Pages. If you plan to deploy your site to https://foo.github.io/bar/,
|
||||
* then publicPath should be set to "/bar/".
|
||||
* In most cases please use '/' !!!
|
||||
* Detail: https://cli.vuejs.org/config/#publicpath
|
||||
*/
|
||||
publicPath: '/admin/',
|
||||
outputDir: './dist',
|
||||
assetsDir: 'static',
|
||||
css: {
|
||||
loaderOptions: { // 向 CSS 相关的 loader 传递选项
|
||||
less: {
|
||||
javascriptEnabled: true
|
||||
}
|
||||
}
|
||||
},
|
||||
lintOnSave: process.env.NODE_ENV === 'development',
|
||||
productionSourceMap: false,
|
||||
devServer: {
|
||||
port: port,
|
||||
open: true,
|
||||
overlay: {
|
||||
warnings: false,
|
||||
errors: true
|
||||
},
|
||||
//before: require('./mock/mock-server.js'),
|
||||
proxy: {
|
||||
[process.env.VUE_APP_BASE_API]: {
|
||||
target: process.env.VUE_APP_BASE_API,
|
||||
changeOrigin: true, //配置跨域
|
||||
pathRewrite: {
|
||||
['^' + process.env.VUE_APP_BASE_API]: process.env.VUE_APP_BASE_API
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
configureWebpack: {
|
||||
// provide the app's title in webpack's name field, so that
|
||||
// it can be accessed in index.html to inject the correct title.
|
||||
name: name,
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': resolve('src')
|
||||
}
|
||||
}
|
||||
},
|
||||
chainWebpack(config) {
|
||||
// it can improve the speed of the first screen, it is recommended to turn on preload
|
||||
config.plugin('preload').tap(() => [{
|
||||
rel: 'preload',
|
||||
// to ignore runtime.js
|
||||
// https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/config/app.js#L171
|
||||
fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/],
|
||||
include: 'initial'
|
||||
}])
|
||||
|
||||
// when there are many pages, it will cause too many meaningless requests
|
||||
config.plugins.delete('prefetch')
|
||||
|
||||
// set svg-sprite-loader
|
||||
config.module
|
||||
.rule('svg')
|
||||
.exclude.add(resolve('src/icons'))
|
||||
.end()
|
||||
config.module
|
||||
.rule('icons')
|
||||
.test(/\.svg$/)
|
||||
.include.add(resolve('src/icons'))
|
||||
.end()
|
||||
.use('svg-sprite-loader')
|
||||
.loader('svg-sprite-loader')
|
||||
.options({
|
||||
symbolId: 'icon-[name]'
|
||||
})
|
||||
.end()
|
||||
|
||||
// set preserveWhitespace
|
||||
config.module
|
||||
.rule('vue')
|
||||
.use('vue-loader')
|
||||
.loader('vue-loader')
|
||||
.tap(options => {
|
||||
options.compilerOptions.preserveWhitespace = true
|
||||
return options
|
||||
})
|
||||
.end()
|
||||
|
||||
config
|
||||
.when(process.env.NODE_ENV !== 'development',
|
||||
config => {
|
||||
config
|
||||
.plugin('ScriptExtHtmlWebpackPlugin')
|
||||
.after('html')
|
||||
.use('script-ext-html-webpack-plugin', [{
|
||||
// `runtime` must same as runtimeChunk name. default is `runtime`
|
||||
inline: /runtime\..*\.js$/
|
||||
}])
|
||||
.end()
|
||||
config
|
||||
.optimization.splitChunks({
|
||||
chunks: 'all',
|
||||
cacheGroups: {
|
||||
libs: {
|
||||
name: 'chunk-libs',
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
priority: 10,
|
||||
chunks: 'initial' // only package third parties that are initially dependent
|
||||
},
|
||||
elementUI: {
|
||||
name: 'chunk-elementUI', // split elementUI into a single package
|
||||
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
|
||||
test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
|
||||
},
|
||||
commons: {
|
||||
name: 'chunk-commons',
|
||||
test: resolve('src/components'), // can customize your rules
|
||||
minChunks: 3, // minimum common number
|
||||
priority: 5,
|
||||
reuseExistingChunk: true
|
||||
}
|
||||
}
|
||||
})
|
||||
// https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk
|
||||
config.optimization.runtimeChunk('single')
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in new issue