Merge remote-tracking branch 'origin/dev'

This commit is contained in:
纪寒 2022-11-17 12:37:02 +08:00
commit 2a8c8af8bd
7 changed files with 496 additions and 30 deletions

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询护理员App文件管理列表
export function listAppFileInfo(query) {
return request({
url: '/system/appFileInfo/list',
method: 'get',
params: query
})
}
// 查询护理员App文件管理详细
export function getAppFileInfo(id) {
return request({
url: '/system/appFileInfo/' + id,
method: 'get'
})
}
// 新增护理员App文件管理
export function addAppFileInfo(data) {
return request({
url: '/system/appFileInfo',
method: 'post',
data: data
})
}
// 修改护理员App文件管理
export function updateAppFileInfo(data) {
return request({
url: '/system/appFileInfo',
method: 'put',
data: data
})
}
// 删除护理员App文件管理
export function delAppFileInfo(id) {
return request({
url: '/system/appFileInfo/' + id,
method: 'delete'
})
}

View File

@ -870,7 +870,7 @@ export default {
updateGoodsInfo(this.form).then((response) => {
var obj = { pictureUrlList: [] };
if (this.imgone != this.form.goodsPictureUrl) {
obj.pictureUrlList.push(this.form.goodsPictureUrl);
obj.pictureUrlList.push(this.imgone);
}
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {

View File

@ -0,0 +1,408 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="文件名称" prop="fileName">
<el-input
v-model="queryParams.fileName"
placeholder="请输入文件名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="版本号" prop="fileVersion">
<el-input
v-model="queryParams.fileVersion"
placeholder="请输入版本号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:appFileInfo:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:appFileInfo:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:appFileInfo:remove']"
>删除</el-button>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:appFileInfo:export']"
>导出</el-button>
</el-col> -->
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handledata"
v-hasPermi="['system:appFileInfo:importData']"
>上传</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="appFileInfoList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="主键id" align="center" prop="id" /> -->
<el-table-column label="文件名称" align="center" prop="fileName" />
<el-table-column label="文件地址" align="center" prop="fileUrl" />
<el-table-column label="版本号" align="center" prop="fileVersion" />
<el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column label="创建时间" align="center" prop="createTime" />
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:appFileInfo:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:appFileInfo:remove']"
>删除</el-button>
</template>
</el-table-column> -->
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改护理员App文件管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="文件名称" prop="fileName">
<el-input v-model="form.fileName" placeholder="请输入文件名称" />
</el-form-item>
<el-form-item label="文件地址" prop="fileUrl">
<el-input
v-model="form.fileUrl"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item>
<el-form-item label="版本号" prop="fileVersion">
<el-input v-model="form.fileVersion" placeholder="请输入版本号" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- // -->
<el-dialog
:title="upload.title"
:visible.sync="upload.open"
width="400px"
append-to-body
>
<el-form>
<el-form-item label="版本号" prop="versions" label-width="60px">
<el-input placeholder="请输入版本号" v-model="versions" />
</el-form-item>
</el-form>
<el-upload
ref="upload"
:limit="1"
accept=".apk"
:headers="upload.headers"
:action="upload.url"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
:data="{
version: versions,
}"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<span>仅允许上传.apk格式文件</span>
<!-- <el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>下载模板</el-link
> -->
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listAppFileInfo, getAppFileInfo, delAppFileInfo, addAppFileInfo, updateAppFileInfo } from "@/api/system/appFileInfo";
import { getToken } from "@/utils/auth";
export default {
name: "AppFileInfo",
data() {
return {
versions: '',//banbenhao
//
upload: {
//
open: false,
//
title: "",
//
isUploading: false,
//
headers: { Authorization: "Bearer " + getToken() },
//
url:
process.env.VUE_APP_BASE_API +
"/system/appFileInfo/uploadAppFileUrl",
},
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// App
appFileInfoList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
fileName: null,
fileUrl: null,
fileVersion: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询护理员App文件管理列表 */
getList() {
this.loading = true;
listAppFileInfo(this.queryParams).then(response => {
this.appFileInfoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
fileName: null,
fileUrl: null,
fileVersion: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加护理员App文件管理";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getAppFileInfo(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改护理员App文件管理";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateAppFileInfo(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addAppFileInfo(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 导入按钮操作 */
handledata() {
this.versions=""
this.upload.title = "护理员App文件导入";
this.upload.open = true;
},
/** 下载模板操作 */
// importTemplate() {
// this.download(
// "/system/station/downloadTemplate?fileType=nurseStation",
// {},
// `App.xlsx`
// );
// },
//
submitFileForm() {
this.$refs.upload.submit();
},
//
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果",
{ dangerouslyUseHTMLString: true }
);
this.getList();
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除护理员App文件管理编号为"' + ids + '"的数据项?').then(function () {
return delAppFileInfo(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => { });
},
/** 导出按钮操作 */
handleExport() {
this.download('system/appFileInfo/export', {
...this.queryParams
}, `appFileInfo_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -364,7 +364,7 @@ export default {
updateGoodsCategory(this.form).then((response) => {
var obj = { pictureUrlList: [] };
if (this.imgone != this.form.goodsCategoryPicture) {
obj.pictureUrlList.push(this.form.goodsCategoryPicture);
obj.pictureUrlList.push(this.imgone);
}
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {

View File

@ -861,7 +861,7 @@ export default {
updateGoodsInfo(this.form).then((response) => {
var obj = { pictureUrlList: [] };
if (this.imgone != this.form.goodsPictureUrl) {
obj.pictureUrlList.push(this.form.goodsPictureUrl);
obj.pictureUrlList.push(this.imgone);
}
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {

View File

@ -8,7 +8,7 @@
<img
v-if="options.img"
v-bind:src="options.img"
title="点击上传头像"
title="点击上传图片"
style="width: 100px; height: 100px; line-height: 200px"
/>
<i
@ -24,15 +24,15 @@
</div>
<el-dialog
:title="title"
title="上传图片"
:visible.sync="openimg"
width="800px"
width="950px"
append-to-body
@opened="modalOpened"
@close="closeDialog"
>
<el-row>
<el-col :xs="24" :md="12" :style="{ height: '350px' }">
<el-col :xs="24" :md="0" :style="{ height: '350px' }">
<vue-cropper
ref="cropper"
:img="options.img"
@ -47,7 +47,12 @@
</el-col>
<el-col :xs="24" :md="12" :style="{ height: '350px' }">
<div class="avatar-upload-preview">
<img :src="previews.url" :style="previews.img" />
<img
style="width: 100%; height: 100%"
v-if="previews.url"
:src="previews.url"
/>
<div v-else></div>
</div>
</el-col>
</el-row>
@ -126,8 +131,8 @@ export default {
options: {
img: null, //
autoCrop: true, //
autoCropWidth: 200, //
autoCropHeight: 200, //
autoCropWidth: 300, //
autoCropHeight: 300, //
fixedBox: true, //
},
previews: {},
@ -200,34 +205,34 @@ export default {
);
} else {
const reader = new FileReader();
this.previews.data = file;
this.previews.url = URL.createObjectURL(file);
reader.readAsDataURL(file);
reader.onload = () => {
this.options.img = reader.result;
// this.options.img = reader.result;
};
}
},
//
uploadImg() {
// console.log(this.types);
this.$refs.cropper.getCropBlob((data) => {
let formData = new FormData();
formData.append("file", data);
formData.append("type", this.types);
updateNurseStationHeads(formData).then((response) => {
this.options.img = baseurl + response.imgUrl;
this.$emit("imgUrl", response.imgUrl);
console.log(this.items);
console.log(this.types);
if (this.types == "attributePitureUrl") {
this.items.attributePitureUrl = response.imgUrl;
this.$emit("item", JSON.stringify(this.items));
}
this.openimg = false;
});
let formData = new FormData();
formData.append("file", this.previews.data);
formData.append("type", this.types);
updateNurseStationHeads(formData).then((response) => {
this.options.img = baseurl + response.imgUrl;
this.$emit("imgUrl", response.imgUrl);
console.log(this.items);
console.log(this.types);
if (this.types == "attributePitureUrl") {
this.items.attributePitureUrl = response.imgUrl;
this.$emit("item", JSON.stringify(this.items));
}
this.openimg = false;
});
},
//
realTime(data) {
console.log(data);
this.previews = data;
},
//
@ -239,6 +244,17 @@ export default {
};
</script>
<style scoped lang="scss">
.avatar-upload-preview {
position: absolute;
top: 0%;
left: 50%;
transform: translate(-50%, 0%);
width: 300px;
height: 300px;
border-radius: 0%;
box-shadow: 0 0 4px #ccc;
overflow: hidden;
}
.user-info-head {
position: relative;
display: inline-block;

View File

@ -1164,9 +1164,7 @@ export default {
updateNurseItem(this.form).then((response) => {
var obj = { pictureUrlList: [] };
if (this.imgone != this.form.nurseStationItem.itemPictureUrl) {
obj.pictureUrlList.push(
this.form.nurseStationItem.itemPictureUrl
);
obj.pictureUrlList.push(this.imgone);
}
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {