master
xy 2 years ago
parent 5fad8feba8
commit 22b62fdd03

@ -573,9 +573,6 @@ export default {
btns.set(
"detail",
<i-button
style={{
"margin-right": "6px",
}}
type="primary"
size="small"
ghost={true}
@ -587,9 +584,6 @@ export default {
btns.set(
"edit",
<i-button
style={{
"margin-right": "6px",
}}
type="primary"
size="small"
onClick={() => _this.editorClick(scope.row, "edit")}
@ -1054,4 +1048,8 @@ export default {
opacity: 1;
}
}
Button + Button {
margin-left: 6px;
}
</style>

@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 4177958 */
src: url('iconfont.woff2?t=1689926089256') format('woff2'),
url('iconfont.woff?t=1689926089256') format('woff'),
url('iconfont.ttf?t=1689926089256') format('truetype');
src: url('iconfont.woff2?t=1692580947552') format('woff2'),
url('iconfont.woff?t=1692580947552') format('woff'),
url('iconfont.ttf?t=1692580947552') format('truetype');
}
.iconfont {
@ -13,6 +13,14 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-ditu:before {
content: "\e608";
}
.icon-zichanxinxi:before {
content: "\e7ec";
}
.icon-zaixianquhao:before {
content: "\e63a";
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,254 @@
<template>
<div>
<Modal
ref="dialog"
v-model="isShow"
title="图集"
:footer-hide="true"
>
<el-upload
style="width: 400px"
ref="upload"
multiple
:on-success="successHandle"
:before-upload="uploadBefore"
:before-remove="beforeRemove"
accept=".jpg,.png,.gif"
:action="action"
:file-list="fileList"
:on-remove="removeHande"
:limit="100"
list-type="picture"
>
<el-button slot="trigger" size="small" type="primary"
>选取文件</el-button
>
<div slot="tip" class="el-upload__tip">
只能上传jpg/png文件且不超过500kb
<br />单个文件不能超过50M
</div>
</el-upload>
</Modal>
</div>
</template>
<script>
import { save, index, destroy } from "@/api/system/baseForm";
export default {
props: {},
data() {
return {
isShow: false,
id: "",
type: "",
action: process.env.VUE_APP_UPLOAD_API,
fileList: [],
form: {
file: []
},
rules: {
name: [
{
required: true,
message: "请填写名称",
},
],
upload_id: [
{
validator: (rule, value, callback) => {
if (this.fileList.length > 0) {
callback();
} else {
callback(new Error("请上传文件"));
}
},
message: "请上传文件",
},
],
},
};
},
methods: {
show() {
this.isShow = true;
},
hidden() {
this.isShow = false;
},
init() {
this.form = {
name: "",
upload_id: "",
model_id: "",
model_type: "customer",
};
},
setId(id) {
if (typeof id == "number") {
this.id = id;
} else {
console.error("error typeof id: " + typeof id);
}
},
getId() {
return this.id;
},
setType(type = "add") {
let types = ["add", "editor"];
if (types.includes(type)) {
this.type = type;
} else {
console.warn("Unknown type: " + type);
}
},
setForm(key = [], value = []) {
if (key instanceof Array) {
key.forEach((key, index) => {
this.form[key] = value[index] ?? "";
});
}
if (typeof key === "string") {
this.form[key] = value;
}
if (!key) {
this.init();
}
},
//
successHandle(response, file, fileList) {
this.fileList = fileList;
this.submit(response);
},
removeHande(file, fileList) {
this.fileList = fileList;
},
uploadBefore(file) {
console.log(file);
if (file.size / 1000 > 50 * 1024) {
this.$message({
type: "warning",
message: "上传图片大小超过50M",
});
return false;
}
},
beforeRemove(file,fileList){
return this.$confirm('确认要删除吗?').then(res => {
destroy({
table_name: 'assets_atlas_files',
id: file.response.id
}).then(_ => true).catch(_ => false)
})
},
async getDetail() {
const res = await index({
table_name: 'assets_atlas_files',
page: 1,
page_size: 999,
filter: [
{
key: 'asset_id',
op: 'eq',
value: this.id
}
]
});
this.fileList = res.data.map((item) => {
return {
name: item.original_name,
url: item.url,
response: item,
};
});
this.$integrateData(this.form, res);
},
submit(response) {
save({
table_name: 'assets_atlas_files',
file_id: response.id,
asset_id: this.id,
name: response.name,
original_name: response.original_name,
url: response.url
}).then(res => {
this.$message({
type: 'success',
message: '图集上传成功'
})
})
},
},
watch: {
isShow(val) {
if (val) {
this.getDetail();
} else {
this.id = "";
this.type = "";
this.fileList = [];
this.$refs["dialog"]?.clearValidate();
}
},
},
};
</script>
<style scoped lang="scss">
::v-deep .el-input__inner {
text-align: left;
}
.img__delete {
transform: scale(0.8, 0.8);
position: absolute;
top: 4px;
right: 4px;
}
::v-deep .avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
::v-deep .avatar-uploader .el-upload:hover {
border-color: $primaryColor;
}
::v-deep .el-upload--picture-card {
font-size: 28px;
color: #8c939d;
width: 80px !important;
height: 80px !important;
line-height: 80px !important;
text-align: center;
}
::v-deep .avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 80px !important;
height: 80px !important;
line-height: 80px !important;
text-align: center;
}
::v-deep .avatar {
width: 80px !important;
display: block;
border-radius: 6px;
}
::v-deep .el-input__inner {
text-align: left;
}
</style>

@ -16,10 +16,10 @@
<el-row :gutter="20">
<el-col :span="14">
<el-card v-if="detail.id_assets_picture_files_file_id_relation && detail.id_assets_picture_files_file_id_relation.length > 0">
<el-card v-if="detail.id_assets_atlas_files_asset_id_relation && detail.id_assets_atlas_files_asset_id_relation.length > 0">
<div class="el-descriptions__header el-descriptions__title">资产图集</div>
<el-carousel trigger="click" height="150px">
<el-carousel-item v-for="item in detail.id_assets_picture_files_file_id_relation">
<el-carousel-item v-for="item in detail.id_assets_atlas_files_asset_id_relation">
<el-image
style="width: 100%; height: 100%;"
:src="item.url"
@ -121,7 +121,7 @@ export default {
units: new Map([
['jianzhu','m²'],
['jianzhumianji','m²'],
['jianzhugaodu','m'],
['dikuaizongjia','元'],
['dikuaimianji','m²'],

@ -155,7 +155,7 @@ export default {
"锡山区",
],
units: new Map([
['jianzhu','m²'],
['jianzhumianji','m²'],
['jianzhugaodu','m'],
['dikuaizongjia','元'],
['dikuaimianji','m²'],

@ -237,6 +237,7 @@
</div>
<xy-table
:btn-width="300"
:auths="auths_auth_mixin"
:delay-req="true"
:destroy-action="destroy"
@ -272,6 +273,15 @@
>历史</Button
>
</template>
<template #picture="{row}">
<Button
size="small"
type="primary"
@click="$refs['atlas'].setId(row.id),$refs['atlas'].show()"
>图集</Button
>
</template>
</xy-table>
<dialoger
@ -293,6 +303,7 @@
@refresh="$refs['xyTable'].getTableData()"
></imports>
<assetsHistory ref="assetsHistory"></assetsHistory>
<atlas ref="atlas"></atlas>
</div>
</template>
@ -314,6 +325,7 @@ import headerContent from "@/components/LxHeader/XyContent.vue";
import drawer from "@/views/component/drawer.vue";
import imports from "./imports.vue";
import assetsHistory from "@/views/assets/assetsHistory.vue";
import atlas from "@/views/assets/atlas.vue";
export default {
components: {
LxHeader,
@ -322,7 +334,8 @@ export default {
drawer,
imports,
assetsHistory
assetsHistory,
atlas
},
mixins: [authMixin],
provide: {
@ -566,7 +579,7 @@ export default {
}
}
let alignLeft = ['dikuaimingcheng']
let alignLeft = ['dikuaimingcheng','chengjiandanwei','jianshedanwei','wuyedanwei']
this.table.push(
Object.assign(
{

@ -50,7 +50,6 @@
<Button
type="primary"
size="small"
style="margin-right: 6px"
@click="
$refs['formEditor'].set(
['custom_form_id', 'custom_form'],
@ -63,7 +62,6 @@
<Button
type="primary"
size="small"
style="margin-right: 6px"
@click="
$refs['linkWith'].set(
['tableName', 'copyTable'],
@ -76,7 +74,6 @@
<Button
type="primary"
size="small"
style="margin-right: 6px"
@click="clone(scope)"
>克隆</Button
>

Loading…
Cancel
Save