parent
44e8c7cbc4
commit
bf86bf69b1
@ -1,14 +1,14 @@
|
|||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 烟草管理系统
|
VUE_APP_TITLE = 烟草图片助手
|
||||||
|
|
||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
ENV = 'development'
|
ENV = 'development'
|
||||||
|
|
||||||
# 烟草管理系统/开发环境
|
# 烟草图片助手/开发环境
|
||||||
#VUE_APP_BASE_API = 'http://124.71.134.146:8096/prod-api'
|
#VUE_APP_BASE_API = 'http://124.71.134.146:8096/prod-api'
|
||||||
VUE_APP_BASE_API = 'http://localhost:8080'
|
# VUE_APP_BASE_API = 'http://localhost:8080'
|
||||||
# VUE_APP_BASE_API = 'http://tanjunwei.test.jiutianda.cn'
|
# VUE_APP_BASE_API = 'https://tobacco2.test.jiutianda.cn'
|
||||||
# VUE_APP_BASE_API = 'http://wangyi.test.jiutianda.cn'
|
VUE_APP_BASE_API = 'http://wangyi.test.jiutianda.cn'
|
||||||
|
|
||||||
# 路由懒加载
|
# 路由懒加载
|
||||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 烟草管理系统
|
VUE_APP_TITLE = 烟草图片助手
|
||||||
|
|
||||||
# 生产环境配置
|
# 生产环境配置
|
||||||
ENV = 'production'
|
ENV = 'production'
|
||||||
|
|
||||||
# 烟草管理系统/生产环境
|
# 烟草图片助手/生产环境
|
||||||
VUE_APP_BASE_API = '/prod-api'
|
VUE_APP_BASE_API = '/prod-api'
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 烟草管理系统
|
VUE_APP_TITLE = 烟草图片助手
|
||||||
|
|
||||||
NODE_ENV = production
|
NODE_ENV = production
|
||||||
|
|
||||||
# 测试环境配置
|
# 测试环境配置
|
||||||
ENV = 'staging'
|
ENV = 'staging'
|
||||||
|
|
||||||
# 烟草管理系统/测试环境
|
# 烟草图片助手/测试环境
|
||||||
VUE_APP_BASE_API = '/stage-api'
|
VUE_APP_BASE_API = '/stage-api'
|
||||||
|
@ -0,0 +1,185 @@
|
|||||||
|
<!-- 通用选择 -->
|
||||||
|
<template>
|
||||||
|
<el-select style="width: 100%" v-bind="$attrs" v-model="selValue" :placeholder="placeholder" :clearable="clearable"
|
||||||
|
:filterable="filterable" :value-key="valueKey" :remote="filterable && pageAble && pageParam.pageSize < total"
|
||||||
|
:remote-method="remoteMethod" :loading="loading" @change="change">
|
||||||
|
<slot name="header"></slot>
|
||||||
|
<el-option v-for="(v, index) in options" :key="index" :label="v[labelKey]" :value="v[valueKey] + ''">
|
||||||
|
<slot :index="index" :row="v"></slot>
|
||||||
|
</el-option>
|
||||||
|
<el-pagination
|
||||||
|
v-if="pageAble"
|
||||||
|
:pager-count="5"
|
||||||
|
hide-on-single-page
|
||||||
|
layout="prev, pager, next"
|
||||||
|
:total="total"
|
||||||
|
:current-page.sync="pageParam.pageNum"
|
||||||
|
@current-change="getList"
|
||||||
|
>
|
||||||
|
</el-pagination>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'NomalSelect',
|
||||||
|
props: {
|
||||||
|
apiMethod: {
|
||||||
|
type: Function,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
// 参数是否同步
|
||||||
|
syncQuery: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
labelKey: {
|
||||||
|
type: String,
|
||||||
|
default: 'label'
|
||||||
|
},
|
||||||
|
valueKey: {
|
||||||
|
type: String,
|
||||||
|
default: 'id'
|
||||||
|
},
|
||||||
|
value: {
|
||||||
|
type: [String, Number, Array],
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
placeholder: {
|
||||||
|
type: String,
|
||||||
|
default: '请选择'
|
||||||
|
},
|
||||||
|
clearable: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
filterable: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
query: {
|
||||||
|
type: [Object, Number, String],
|
||||||
|
default: () => ({})
|
||||||
|
},
|
||||||
|
isPathQuery: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
// 是否分页
|
||||||
|
pageAble: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
selValue: typeof this.value === 'string' || typeof this.value === 'number' ? this.value + '' : this.value,
|
||||||
|
options: [],
|
||||||
|
total: 0,
|
||||||
|
pageParam: this.pageAble ? { pageNum: 1, pageSize: 10 } : {},
|
||||||
|
loading: false,
|
||||||
|
timer: null,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
value() {
|
||||||
|
if (typeof this.value === 'string' || typeof this.value === 'number') {
|
||||||
|
this.selValue = this.value + '';
|
||||||
|
} else {
|
||||||
|
this.selValue = this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
apiMethod() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
query: {
|
||||||
|
handler() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
model: {
|
||||||
|
prop: 'value',
|
||||||
|
event: 'change'
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
refresh() {
|
||||||
|
this.pageParam = this.pageAble ? { pageNum: 1, pageSize: 10 } : {};
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
getList() {
|
||||||
|
if (!this.apiMethod) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.isPathQuery) {
|
||||||
|
if (!this.query || typeof this.query === 'object') {
|
||||||
|
this.options = [];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.loading = true;
|
||||||
|
this.apiMethod(this.query).then(res => {
|
||||||
|
this.options = res?.rows || res.data || [];
|
||||||
|
this.total = res?.total || this.options.length || 0;
|
||||||
|
this.loading = false;
|
||||||
|
|
||||||
|
}).catch(err => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.loading = true;
|
||||||
|
this.apiMethod(this.syncQuery ? {
|
||||||
|
...this.pageParam,
|
||||||
|
...this.query,
|
||||||
|
}: this.pageParam, this.query).then(res => {
|
||||||
|
this.options = res?.rows || res.data || [];
|
||||||
|
this.total = res?.total || this.options.length || 0;
|
||||||
|
this.loading = false;
|
||||||
|
}).catch(err => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 远程搜索
|
||||||
|
remoteMethod(query) {
|
||||||
|
if (this.timer) {
|
||||||
|
clearTimeout(this.timer);
|
||||||
|
}
|
||||||
|
this.timer = setTimeout(() => {
|
||||||
|
this.timer = null;
|
||||||
|
this.pageParam = {
|
||||||
|
...this.pageParam,
|
||||||
|
pageNum: 1,
|
||||||
|
[this.labelKey]: query
|
||||||
|
};
|
||||||
|
|
||||||
|
this.getList();
|
||||||
|
}, 300);
|
||||||
|
|
||||||
|
},
|
||||||
|
change(val) {
|
||||||
|
this.$emit('change', val);
|
||||||
|
// 返回选中的原始数据
|
||||||
|
if (this.$attrs.multiple) {
|
||||||
|
const selvs = val.map(element => {
|
||||||
|
const findex = this.options.findIndex(v => v[this.valueKey] == element);
|
||||||
|
return this.options[findex] || {};
|
||||||
|
});
|
||||||
|
this.$emit('rowChange', selvs);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const findex = this.options.findIndex(v => v[this.valueKey] == val);
|
||||||
|
if (findex > -1) {
|
||||||
|
this.$emit('rowChange', this.options[findex]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped></style>
|
@ -0,0 +1,131 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" append-to-body :visible.sync="dialogVisible" :title="dialogForm.type ==='image'?'共享图片':'共享文件夹'"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
ref="dialogForm"
|
||||||
|
label-position="top"
|
||||||
|
:model="dialogForm"
|
||||||
|
status-icon
|
||||||
|
class="demo-form-inline"
|
||||||
|
label-width="180"
|
||||||
|
:rules="rules"
|
||||||
|
>
|
||||||
|
<el-form-item label="共享对象" prop="userType">
|
||||||
|
<el-select
|
||||||
|
v-model="dialogForm.userType"
|
||||||
|
placeholder="请选择共享对象"
|
||||||
|
style="width: 100%;"
|
||||||
|
@change="userTypeChange"
|
||||||
|
>
|
||||||
|
<el-option label="用户" value="user" />
|
||||||
|
<el-option label="部门" value="dept" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="共享到" prop="userIds">
|
||||||
|
<NomalSelect v-if="dialogForm.userType === 'user'"
|
||||||
|
v-model="dialogForm.userIds"
|
||||||
|
placeholder="请选择用户"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
:multiple="true" :apiMethod="listUser" labelKey="userName"
|
||||||
|
valueKey="userId"
|
||||||
|
style="width: 100%;"
|
||||||
|
></NomalSelect>
|
||||||
|
<treeselect v-else v-model="dialogForm.userIds" :options="depts" multiple :show-count="true" placeholder="请选择共享部门" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="生效开始时间" prop="beginDate">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dialogForm.beginDate"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
type="date"
|
||||||
|
style="width: 100%;"
|
||||||
|
placeholder="选择日期"
|
||||||
|
></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="生效结束时间" prop="endDate">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dialogForm.endDate"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
type="date"
|
||||||
|
placeholder="选择日期"
|
||||||
|
clearable
|
||||||
|
style="width: 100%;"
|
||||||
|
></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="closeVisible">取消</el-button>
|
||||||
|
<el-button type="primary" v-loading="saving" @click="submitForm">确定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import TableEditMixin from "@/mixins/table-edit-mixin";
|
||||||
|
import { addShare } from "../../../api/gallery/cata/share";
|
||||||
|
import { listUser, deptTreeSelect } from "../../../api/system/user";
|
||||||
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
|
import { formatDateStr } from "../../../utils";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ShareDialog',
|
||||||
|
mixins: [TableEditMixin],
|
||||||
|
pageInfo: {
|
||||||
|
defaultForm: {
|
||||||
|
userType: null,
|
||||||
|
userIds: null,
|
||||||
|
cataIds: null,
|
||||||
|
type: 'image',
|
||||||
|
beginDate: null,
|
||||||
|
endDate: null,
|
||||||
|
},
|
||||||
|
title: "共享",
|
||||||
|
// updateApi: updateInfo,
|
||||||
|
addApi: addShare,
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
Treeselect
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
listUser,
|
||||||
|
depts: [],
|
||||||
|
users: [],
|
||||||
|
rules: {
|
||||||
|
userType: [
|
||||||
|
{ required: true, message: "请选择共享对象", trigger: "change" }
|
||||||
|
],
|
||||||
|
userIds: [
|
||||||
|
{ required: true, message: "请选择共享到", trigger: "change" }
|
||||||
|
],
|
||||||
|
beginDate: [
|
||||||
|
{ required: true, message: "请选择生效开始时间", trigger: "change" }
|
||||||
|
],
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
dialogVisible(val) {
|
||||||
|
if (val) {
|
||||||
|
this.dialogForm.beginDate = formatDateStr();
|
||||||
|
deptTreeSelect().then(res => {
|
||||||
|
this.depts = res.data;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
userTypeChange() {
|
||||||
|
this.dialogForm.userIds = null;
|
||||||
|
},
|
||||||
|
mixin_commonMsg() {
|
||||||
|
return '共享成功';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
@ -0,0 +1,75 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container" >
|
||||||
|
<el-form :model="query" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<el-form-item label="关键字搜索" prop="imageTitle">
|
||||||
|
<el-input
|
||||||
|
v-model="query.imageTitle"
|
||||||
|
placeholder="请输入关键字"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="queryTable">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQueryTable">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div class="image-list">
|
||||||
|
<ImageItem v-for="(item, index) in tableData" :key="index" :item="item" class="image-item" @goDetail="showImageViewer($event, index, item)"></ImageItem>
|
||||||
|
</div>
|
||||||
|
<!-- 表格页脚 -->
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="page.pageNum"
|
||||||
|
:limit.sync="page.pageSize"
|
||||||
|
@pagination="getTableList"
|
||||||
|
/>
|
||||||
|
<MyImageViewer ref="previewImage" :z-index="2000"
|
||||||
|
:files="images" :options="{
|
||||||
|
download: true,
|
||||||
|
print: true,
|
||||||
|
edit: true,
|
||||||
|
check: true,
|
||||||
|
}" @change="imageEditChange"></MyImageViewer>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import ImageItem from '../../gallery/list/components/ImageItem.vue';
|
||||||
|
import tableMixin from '../../../mixins/table-mixin';
|
||||||
|
import { pageListShare } from "@/api/gallery/cata/share";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ShareList',
|
||||||
|
components: {
|
||||||
|
ImageItem,
|
||||||
|
},
|
||||||
|
mixins: [tableMixin],
|
||||||
|
pageInfo: {
|
||||||
|
title: '共享列表',
|
||||||
|
exportUrl: '',
|
||||||
|
pageListApi: pageListShare,
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
imageEditChange() {
|
||||||
|
this.getTableList();
|
||||||
|
},
|
||||||
|
showImageViewer(event, index, item) {
|
||||||
|
console.log('showImageViewer');
|
||||||
|
|
||||||
|
this.$refs.previewImage.open(index);
|
||||||
|
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
Loading…
Reference in new issue