master
xy 1 year ago
parent 42192dbeb5
commit d503e02182

@ -4,5 +4,5 @@ ENV='development'
# base api
VUE_APP_BASE_API=http://wuxiwuye.ali251.langye.net/
VUE_APP_UPLOAD_API=http://wuxiwuye.ali251.langye.net/api/admin/upload-file
VUE_APP_PREVIEW=http://view.ali251.langye.net:8012/onlinePreview
VUE_APP_PREVIEW=//view.langye.net:8012/onlinePreview

@ -4,10 +4,10 @@ NODE_ENV = production
ENV = 'staging'
# base api
#VUE_APP_BASE_API=http://wuxiwuye.ali251.langye.net/
#VUE_APP_UPLOAD_API=http://wuxiwuye.ali251.langye.net/api/admin/upload-file
#VUE_APP_PREVIEW=http://view.ali251.langye.net:8012/onlinePreview
VUE_APP_BASE_API=http://wuxiwuye.ali251.langye.net/
VUE_APP_UPLOAD_API=http://wuxiwuye.ali251.langye.net/api/admin/upload-file
VUE_APP_PREVIEW=http://view.ali251.langye.net:8012/onlinePreview
# base api
VUE_APP_BASE_API=http://192.168.221.31:9001/
VUE_APP_UPLOAD_API=http://192.168.221.31:9001/api/admin/upload-file
VUE_APP_PREVIEW=http://192.168.221.31:8012/onlinePreview
#VUE_APP_BASE_API=http://192.168.221.31:9001/
#VUE_APP_UPLOAD_API=http://192.168.221.31:9001/api/admin/upload-file
#VUE_APP_PREVIEW=http://192.168.221.31:8012/onlinePreview

@ -1,9 +1,6 @@
import request from '@/utils/request'
export function listCommondepartment(params) {
return request({
url: '/api/admin/other/admin-department-list',
@ -44,3 +41,11 @@ export function checkSms (params) {
params
})
}
export function getFiles (params) {
return request({
url: "/api/admin/other/files",
method: "get",
params
})
}

@ -184,123 +184,124 @@ export class CreateDialog {
.filter((i) => i.form_show)
.forEach((i, index) => {
let replace = this.replaces.find((j) => j.key === i.field);
dom.push(
h(
"el-form-item",
{
ref: `elFormItem${i.field}`,
style: {
width: "100%",
},
props: {
label: i.name,
prop: i.field,
required:
i.validation instanceof Array
? !!i.validation.find((i) => i === "required")
: false,
if (!(replace && !replace.show)) {
dom.push(
h(
"el-form-item",
{
ref: `elFormItem${i.field}`,
style: {
width: "100%",
},
props: {
label: i.name,
prop: i.field,
required:
i.validation instanceof Array
? !!i.validation.find((i) => i === "required")
: false,
},
},
},
replace && replace.render
? [replace.render]
: [
h(
domMap.get(i.edit_input),
{
ref: `elEdit_${i.field}`,
style: {
width: "100%",
},
props: {
...addPropsMap.get(i.edit_input),
...this.extraProps(i),
placeholder: i.help,
value: that.form[i.field],
readonly: that.type === "show",
//disabled: that.type === 'show',
},
attrs: {
placeholder: i.help || `请填写${i.name}`,
},
on: {
[this.getEventType(i.edit_input)]: (
e
) => {
if (i.field) {
that.form[i.field] = e;
that.form = Object.assign(
{},
that.form
);
}
replace && replace.render
? [replace.render]
: [
h(
domMap.get(i.edit_input),
{
ref: `elEdit_${i.field}`,
style: {
width: "100%",
},
},
scopedSlots:
i.edit_input === "file" ||
i.edit_input === "files"
? {
file: (scope) => {
let { file } = scope;
return [
h("div", {}, [
h("i", {
class: {
"el-icon-circle-check":
file.status ===
"success",
"el-icon-loading":
file.status ===
"uploading",
},
style: {
color:
file.status ===
"success"
? "green"
: "",
},
}),
h(
"a",
{
attrs: {
href: file.url,
download: file.name,
target: "_blank",
},
props: {
...addPropsMap.get(i.edit_input),
...this.extraProps(i),
placeholder: i.help,
value: that.form[i.field],
readonly: that.type === "show",
//disabled: that.type === 'show',
},
attrs: {
placeholder: i.help || `请填写${i.name}`,
},
on: {
[this.getEventType(i.edit_input)]: (
e
) => {
if (i.field) {
that.form[i.field] = e;
that.form = Object.assign(
{},
that.form
);
}
},
},
scopedSlots:
i.edit_input === "file" ||
i.edit_input === "files"
? {
file: (scope) => {
let { file } = scope;
return [
h("div", {}, [
h("i", {
class: {
"uploaded-a":
"el-icon-circle-check":
file.status ===
"success",
"el-icon-loading":
file.status ===
"uploading",
},
style: {
padding: "0 4px",
color:
file.status ===
"success"
? "green"
: "",
},
}),
h(
"a",
{
attrs: {
href: file.url,
download: file.name,
target: "_blank",
},
class: {
"uploaded-a":
file.status ===
"success",
},
style: {
padding: "0 4px",
},
},
file.original_name || file.name
),
]),
h("i", {
class: "el-icon-close",
on: {
["click"]: () =>
this.fileRemoveHandler(
file,
i.field
),
},
file.name
),
]),
h("i", {
class: "el-icon-close",
on: {
["click"]: () =>
this.fileRemoveHandler(
file,
i.field
),
},
}),
];
},
}
: "",
},
this.optionsRender(h, i)
),
]
)
);
}),
];
},
}
: "",
},
this.optionsRender(h, i)
),
]
)
);
}
});
this.replaces.forEach((replace) => {

@ -89,30 +89,16 @@ export default {
this.$integrateData(this.form, res);
this.formInfo.forEach((i) => {
if (i && (i.edit_input === "file" || i.edit_input === "files")) {
res[i._relations.link_with_name]
? (this.file[i.field] =
res[i._relations.link_with_name] instanceof Array
? res[i._relations.link_with_name].map((i) => {
return {
name: i?.name,
url: i?.url,
response: i,
};
})
: [
{
name: res[i._relations.link_with_name]?.name,
url: res[i._relations.link_with_name]?.url,
response: res[i._relations.link_with_name],
},
])
: (this.file[i.field] = []);
if (i.edit_input === "file") {
}
if (i.edit_input === "files") {
this.file[i.field] = res[`${i.field}_upload_details`]
}
this.form = Object.assign({}, this.form);
this.originalForm = deepCopy(res);
});
this.form = Object.assign({}, this.form);
this.originalForm = deepCopy(res);
},
submit() {
@ -153,30 +139,13 @@ export default {
}
}
if (
info._relations?.link_relation === "newHasMany" ||
info._relations?.link_relation === "hasMany"
) {
if (info.edit_input === "files") {
this.form[info._relations.link_with_name] = this.file[
info.field
]?.map((i) => {
let copyRelation = i?.response ? deepCopy(i?.response) : "";
//TODO:
if (/:\/\/:\/\//g.test(copyRelation?.url)) {
copyRelation.url.replace(/:\/\/:\/\//g,'://')
}
delete copyRelation.id;
return {
file_id: i?.response?.id,
...copyRelation,
};
});
}
if (info.edit_input === "files") {
this.form[info.field] = this.file[
info.field
]?.map((i) => i?.response?.id);
}
})
delete this.form['tupian']
save(Object.assign(this.form, { table_name: 'his_evolutions' })).then(res => {
this.$Message.success({
content: `${this.type === "add" ? "新增" : "编辑"}成功`,

@ -73,7 +73,7 @@ export default {
res[i._relations.link_with_name] instanceof Array
? res[i._relations.link_with_name].map((i) => {
return {
name: i?.name,
name: i?.original_name || i?.name,
url: i?.url,
response: i,
};
@ -87,10 +87,9 @@ export default {
])
: (this.file[i.field] = []);
}
this.form = Object.assign({}, this.form);
this.originalForm = deepCopy(res);
});
this.form = Object.assign({}, this.form);
this.originalForm = deepCopy(res);
},
submit() {

@ -178,7 +178,7 @@ export default {
res[i._relations.link_with_name] instanceof Array
? res[i._relations.link_with_name].map((i) => {
return {
name: i?.name,
name: i?.original_name || i?.name,
url: i?.url,
response: i,
};

@ -9,7 +9,18 @@ export default {
},
render(h) {
let dialog = new CreateDialog(this,[
{
show: false,
key: 'land_id',
label: '',
render: () => {}
},
{
show: false,
key: 'house_id',
label: '',
render: () => {}
}
],{
width: "650px"
})
@ -87,30 +98,15 @@ export default {
this.$integrateData(this.form, res);
this.formInfo.forEach((i) => {
if (i && (i.edit_input === "file" || i.edit_input === "files")) {
res[i._relations.link_with_name]
? (this.file[i.field] =
res[i._relations.link_with_name] instanceof Array
? res[i._relations.link_with_name].map((i) => {
return {
name: i?.original_name,
url: i?.url,
response: i,
};
})
: [
{
name: res[i._relations.link_with_name]?.name,
url: res[i._relations.link_with_name]?.url,
response: res[i._relations.link_with_name],
},
])
: (this.file[i.field] = []);
}
if (i.edit_input === "file") {
this.form = Object.assign({}, this.form);
this.originalForm = deepCopy(res);
}
if (i.edit_input === "files") {
this.file[i.field] = res[`${i.field}_upload_details`]
}
});
this.form = Object.assign({}, this.form);
this.originalForm = deepCopy(res);
},
submit() {
@ -159,40 +155,31 @@ export default {
info._relations?.link_relation === "newHasMany" ||
info._relations?.link_relation === "hasMany"
) {
if (info.edit_input === "files") {
copyForm[info._relations.link_with_name] = this.file[
info.field
]?.map((i) => {
let copyRelation = i?.response ? deepCopy(i?.response) : "";
delete copyRelation.id;
return {
upload_id: i?.response?.id,
...copyRelation,
};
});
} else {
copyForm[info._relations.link_with_name] = copyForm[
info.field
]?.map((i) => {
let copyRelation = info._params.find(
(param) => param[info._relations?.foreign_key] === i
)
? deepCopy(
info._params.find(
(param) => param[info._relations?.foreign_key] === i
)
copyForm[info._relations.link_with_name] = copyForm[
info.field
]?.map((i) => {
let copyRelation = info._params.find(
(param) => param[info._relations?.foreign_key] === i
)
? deepCopy(
info._params.find(
(param) => param[info._relations?.foreign_key] === i
)
: "";
delete copyRelation.id;
return {
[info._relations.foreign_key]: i,
...copyRelation,
};
});
}
)
: "";
delete copyRelation.id;
return {
[info._relations.foreign_key]: i,
...copyRelation,
};
});
delete copyForm[info.field];
}
if (info.edit_input === "files") {
copyForm[info.field] = this.file[
info.field
]?.map((i) => i?.response?.id);
}
if (
info._relations?.link_relation === "newHasOne" ||
info._relations?.link_relation === "hasOne"
@ -231,7 +218,6 @@ export default {
}
});
delete this.form['tupian']
save(Object.assign(copyForm, { table_name: 'leases' })).then(res => {
this.$Message.success({
content: `${this.type === "add" ? "新增" : "编辑"}成功`,

@ -90,20 +90,20 @@ export default {
prop: 'yongtu',
width: 160
},
{
label: "附件",
prop: 'file',
minWidth: 180,
customFn:row => {
return (
<div>
{
row.id_lease_file_files_lease_id_relation.map(i => (<a class="original-name-a" on={{click:()=>(window.open(i.url))}}>{i.original_name}</a>))
}
</div>
)
}
}
// {
// label: "",
// prop: 'file',
// minWidth: 180,
// customFn:row => {
// return (
// <div>
// {
// row.file.map(i => (<a class="original-name-a" on={{click:()=>(window.open(i.url))}}>{i.original_name}</a>))
// }
// </div>
// )
// }
// }
],
};
},

@ -80,19 +80,21 @@
detail.id_asset_picture_files_house_id_relation.length > 0)
"
>
<div
v-for="item in /\/land/g.test($route.path) ? detail.id_asset_picture_files_land_id_relation : detail.id_asset_picture_files_house_id_relation"
>
<el-image
style="width: 100%; height: 100%;max-width: 200px;"
:src="item.url"
:preview-src-list="
<div style="display: flex;flex-wrap: wrap;">
<div
v-for="item in /\/land/g.test($route.path) ? detail.id_asset_picture_files_land_id_relation : detail.id_asset_picture_files_house_id_relation"
>
<el-image
style="width: 100%; max-width: 200px;margin-right: 10px;"
:src="item.url"
:preview-src-list="
(/\/land/g.test($route.path) ? detail.id_asset_picture_files_land_id_relation : detail.id_asset_picture_files_house_id_relation).map(
(i) => i.url
)
"
fit="contain"
></el-image>
fit="contain"
></el-image>
</div>
</div>
</template>
<template v-else>
@ -137,17 +139,17 @@
</template>
<div style="display: flex;flex-wrap: wrap;padding-top: 10px;">
<div style="display: flex;flex-direction: column; align-items: center;margin-right: 16px;cursor: pointer;"
v-for="(img,index) in item.id_his_tupian_files_asset_history_id_relation"
:key="img.id"
@click="open(img.url)">
v-for="(img,index) in item.tupian_detail"
:key="img.id">
<!-- <el-image-->
<!-- style="height: 160px"-->
<!-- :src="img.url"-->
<!-- fit="contain"-->
<!-- :preview-src-list="item.id_his_tupian_files_asset_history_id_relation.map(i => i.url)"-->
<!-- ></el-image>-->
<i class="el-icon-document" style="font-size: 24px;"></i>
<div style="color: #3477c6;padding: 10px 0;">{{ ++index }}. <span style="font-weight: 600;">{{ img.original_name }}</span></div>
<i class="el-icon-document" style="font-size: 24px;" @click="open(img.url)"></i>
<div style="color: #3477c6;padding: 10px 0;" @click="open(img.url)">{{ ++index }}. <span style="font-weight: 600;">{{ img.original_name }}</span></div>
<div style="color: #3477c6" @click="down(img)"><i class="el-icon-download"></i>点击下载</div>
</div>
</div>
</el-descriptions-item>
@ -176,6 +178,8 @@
<div class="el-descriptions__header el-descriptions__title">
安全检查
</div>
<xy-table :is-page="false" :height="300" :list="/\/land/g.test(this.$route.path) ? detail.id_asset_safety_inspections_land_id_relation : detail.id_asset_safety_inspections_house_id_relation" :table-item="inspectionTable" style="margin-top: 20px" size="mini" stripe ref="table1" :auths="[]" ></xy-table>
</el-card>
<el-card id="detail-contract">
@ -190,6 +194,8 @@
<div class="el-descriptions__header el-descriptions__title">
维修保养
</div>
<xy-table :is-page="false" :height="300" :list="/\/land/g.test(this.$route.path) ? detail.id_asset_safety_keeps_land_id_relation : detail.id_asset_safety_keeps_house_id_relation" :table-item="keepTable" style="margin-top: 20px" size="mini" stripe ref="table1" :auths="[]" ></xy-table>
</el-card>
<el-card id="detail-files">
@ -293,14 +299,32 @@
<Button size="small" type="success" ghost>资产</Button>
<Button size="small" type="info" ghost>文件</Button>
</div>
<el-input size="mini" style="margin-top: 4px;" placeholder="请输入名称" clearable>
<el-button type="primary" slot="append" icon="el-icon-search"></el-button>
<el-input v-model="searchKeyword" size="mini" style="margin-top: 4px;" placeholder="请输入名称" clearable>
<el-button type="primary" slot="append" icon="el-icon-search" @click="searchFile"></el-button>
</el-input>
<ul>
<li></li>
<li></li>
<li></li>
<ul class="search-file-list">
<li v-for="(item, index) in searchFiles" :key="item.id">
<div style="display: flex;justify-content: space-between;align-items: center;">
<a :download="item.url">{{index+1}}.{{ item.original_name }}</a>
<div>
<el-button
type="primary"
icon="el-icon-download"
circle
size="mini"
@click="down(item)"
></el-button>
<el-button
type="primary"
icon="el-icon-search"
circle
size="mini"
@click="open(item.url)"
></el-button>
</div>
</div>
</li>
</ul>
</template>
</el-card>
@ -316,6 +340,7 @@ import { show as formShow } from "@/api/system/customForm";
import { getparameter } from "@/api/system/dictionary";
import { listdept } from "@/api/system/department";
import { download } from "@/utils/downloadRequest";
import { getFiles } from "@/api/common";
export default {
name: "detail",
data() {
@ -343,6 +368,47 @@ export default {
["muqianjunjia", "元"],
]),
inspectionTable: [
{
fixed: 'left',
type: 'index',
width: 46,
},
{
label: "检查记录",
prop: "jianchajilu",
minWidth: 200,
align: "left"
},
{
label: "日期",
prop: "riqi",
width: 160
}
],
keepTable: [
{
fixed: 'left',
type: 'index',
width: 46,
},
{
label: "保养内容",
prop: "baoyangneirong",
minWidth: 200,
align: "left"
},
{
label: "保养日期",
prop: "baoyangriqi",
width: 160
},
{
label: "经办人",
prop: "jingbanren",
width: 140
}
],
leaseTable: [
{
fixed: 'left',
@ -406,10 +472,25 @@ export default {
prop: 'weidaoweiyuanyin',
minWidth: 140
}
]
],
searchKeyword: "",
searchFiles: [],
};
},
methods: {
async searchFile () {
try {
const res = await getFiles({ keyword: this.searchKeyword });
this.searchFiles = res.list;
console.log(this.searchFiles)
} catch (err) {
}
},
open(url) {
this.codeUri = `${process.env.VUE_APP_PREVIEW}?url=${encodeURIComponent(
new Buffer(url).toString("base64")
@ -740,13 +821,31 @@ a:hover {
}
}
.search-container {
min-width: 300px;
min-width: 460px;
background: #fff;
z-index: 4000;
position: fixed;
right: 100px;
bottom: 30px;
}
.search-file-list {
margin-top: 20px;
li {
transition: all 0.2s;
list-style: none;
line-height: 1.5;
border-radius: 6px;
border: 1px solid transparent;
padding: 6px 10px;
&:hover {
border-color: $primaryColor;
}
}
}
</style>
<style lang="scss">
.map-marker {

@ -529,14 +529,9 @@ export default {
info._relations?.link_relation === "hasMany"
) {
if (info.edit_input === "files") {
copyForm[info._relations.link_with_name] = this.file[
copyForm[info.field] = this.file[
info.field
]?.map((i) => {
return {
upload_id: i?.response?.id,
...i?.response
};
});
]?.map((i) => i?.response?.id);
} else {
copyForm[info._relations.link_with_name] = copyForm[
info.field

Loading…
Cancel
Save