master
xy 2 years ago
parent 22b62fdd03
commit 18152dce3c

@ -1,7 +1,9 @@
<template>
<section class="app-main">
<transition name="fade-transform" mode="out-in">
<router-view :key="key" />
<keep-alive :include="['tableList','mapList']">
<router-view :key="key" />
</keep-alive>
</transition>
</section>
</template>

@ -53,7 +53,7 @@
</template>
<script>
import { save } from "@/api/system/baseForm";
import { save, show } from "@/api/system/baseForm";
import { getToken } from "@/utils/auth";
export default {
@ -62,6 +62,8 @@ export default {
action: process.env.VUE_APP_UPLOAD_API,
dialogVisible: false,
asset_id: "",
id: "",
type: 'add',
form: {
riqi: "",
@ -97,6 +99,17 @@ export default {
hide() {
this.dialogVisible = false;
},
setType(type = "add") {
let types = ["add", "editor"];
if (types.includes(type)) {
this.type = type;
} else {
console.warn("Unknown type: " + type);
}
},
setId (id) {
this.id = id
},
setAssetId(id) {
this.asset_id = id;
},
@ -111,12 +124,41 @@ export default {
this.$refs["elForm"].clearValidate();
},
async getDetail () {
const res = await show({
table_name: 'asset_histories',
id: this.id
})
this.$integrateData(this.form,res)
this.fileList = res.id_his_tupian_files_asset_history_id_relation.map(i => {
return {
response: i,
name: i.original_name,
url: i.url
}
})
},
submit () {
if (this.type === "add") {
if (this.form.hasOwnProperty("id")) {
delete this.form.id;
}
}
if (this.type === "editor") {
Object.defineProperty(this.form, "id", {
value: this.id,
enumerable: true,
configurable: true,
writable: true,
});
}
this.form.id_his_tupian_files_asset_history_id_relation = this.fileList.map(i => {
return {
original_name: i.response.original_name,
name: i.response.name,
url: i.response.url,
url: /:\/\/:\/\//g.test(i.response.url) ? i.response.url.replace(/:\/\/:\/\//g,"://") : i.response.url,
file_id: i.response.id
}
})
@ -131,10 +173,24 @@ export default {
})
this.hide()
this.init()
this.$emit('refresh')
})
}
},
computed: {},
watch: {
dialogVisible (newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.id = '';
this.asset_id = '';
this.fileList = [];
}
}
}
};
</script>

@ -0,0 +1,115 @@
<template>
<div>
<Modal title="资产历史" footer-hide :width="64" v-model="isShow">
<Button type="primary" style="margin-bottom: 10px;" @click="$refs['assetsHistory'].setAssetId(id),$refs['assetsHistory'].show()"></Button>
<xy-table :btn-width="120"
style="width: 100%;"
:auths="['delete','edit']"
:height="360"
ref="xyTable"
delay-req
:table-item="table"
:action="index"
:req-opt="select"
:destroy-req-opt="{ table_name: 'asset_histories' }"
:destroy-action="destroy"
@editor="row => {
$refs['assetsHistory'].setType('editor'),
$refs['assetsHistory'].setId(row.id),
$refs['assetsHistory'].setAssetId(id),
$refs['assetsHistory'].show()
}"></xy-table>
</Modal>
<assetsHistory ref="assetsHistory" @refresh="$refs['xyTable'].getTableData()"></assetsHistory>
</div>
</template>
<script>
import { index, destroy } from "@/api/system/baseForm";
import assetsHistory from '@/views/assets/assetsHistory.vue'
export default {
components: { assetsHistory },
data() {
return {
id: '',
isShow: false,
select: {
table_name: 'asset_histories',
filter: [
{
key: 'asset_id',
op: 'eq',
value: ''
}
]
},
table: [
{
prop: 'riqi',
label: '日期',
width: 200
},
{
prop: 'neirong',
label: '内容',
minWidth: 220,
align: 'left',
customFn:row => {
return (
<div domPropsInnerHTML={ row.neirong }></div>
)
}
},
{
prop: 'picture',
label: '图片',
showOverflowTooltip: false,
minWidth: 360,
align: 'left',
customFn:row => {
return (
<div style="display: grid;grid-template-columns: repeat(4, 1fr);grid-gap: 4px;">
{
row.id_his_tupian_files_asset_history_id_relation.map(i => {
return (
<el-image style="width: 80px;height: 60px;" fit="cover" src={i.url}></el-image>
)
})
}
</div>
)
}
}
]
}
},
methods: {
index,destroy,
show () {
this.isShow = true
},
hide () {
this.isShow = false
},
setId (id) {
if (typeof id === 'number') {
this.id = id
this.select.filter[0].value = id
}
}
},
computed: {},
watch: {
isShow (newVal) {
if (newVal) {
this.$refs['xyTable'].getTableData(true)
}
}
}
}
</script>
<style scoped lang="scss">
</style>

@ -175,7 +175,8 @@ export default {
asset_id: this.id,
name: response.name,
original_name: response.original_name,
url: response.url
//TODO:
url: response.url.replace(/:\/\/:\/\//g,'://')
}).then(res => {
this.$message({
type: 'success',
@ -192,7 +193,6 @@ export default {
this.id = "";
this.type = "";
this.fileList = [];
this.$refs["dialog"]?.clearValidate();
}
},
},

@ -1,7 +1,7 @@
<template>
<div>
<el-page-header
:content="$route.meta.title + (detail.dikuaimingcheng ? ' - ' : '') + detail.dikuaimingcheng"
:content="$route.meta.title + (detail.dikuaimingcheng ? ' - ' + detail.dikuaimingcheng : '')"
style="
padding: 1em;
font-size: 1em;
@ -24,7 +24,7 @@
style="width: 100%; height: 100%;"
:src="item.url"
:preview-src-list="picList"
fit="contain"></el-image>
fit="cover"></el-image>
</el-carousel-item>
</el-carousel>
</el-card>
@ -104,13 +104,13 @@ import { show as formShow } from "@/api/system/customForm";
import { getparameter } from '@/api/system/dictionary'
import { listdept } from '@/api/system/department'
export default {
name: 'detail',
data() {
return {
center: [120.283692, 31.614211],
marker: {},
histories: [],
picList: [],
detail: {},
fields: [],
relation: [],
@ -250,8 +250,6 @@ export default {
})
this.detail = detail
this.init();
this.picList = detail?.id_assets_picture_files_file_id_relation?.map(i => i.url)
},
async getHistory () {
@ -271,6 +269,9 @@ export default {
}
},
computed: {
picList () {
return this.detail?.id_assets_atlas_files_asset_id_relation?.map(i => i.url) || []
},
contentFormat() {
return function (i) {
let { _relations } = i;

@ -456,6 +456,11 @@ export default {
info.field
]?.map((i) => {
let copyRelation = i?.response ? deepCopy(i?.response) : "";
console.log(333,copyRelation)
//TODO:
if (/:\/\/:\/\//g.test(copyRelation?.url)) {
copyRelation.url.replace(/:\/\/:\/\//g,'://')
}
delete copyRelation.id;
return {
upload_id: i?.response?.id,

@ -100,6 +100,7 @@ import { show } from "@/api/system/customForm";
import { listdept } from "@/api/system/department";
import { getparameter } from "@/api/system/dictionary";
export default {
name: 'mapList',
data() {
return {
dragging: false,

@ -269,7 +269,7 @@
<Button
size="small"
type="primary"
@click="$refs['assetsHistory'].setAssetId(row.id),$refs['assetsHistory'].show()"
@click="$refs['assetsHistoryList'].setId(row.id),$refs['assetsHistoryList'].show()"
>历史</Button
>
</template>
@ -302,8 +302,8 @@
ref="imports"
@refresh="$refs['xyTable'].getTableData()"
></imports>
<assetsHistory ref="assetsHistory"></assetsHistory>
<atlas ref="atlas"></atlas>
<assetsHistoryList ref="assetsHistoryList"></assetsHistoryList>
</div>
</template>
@ -324,9 +324,10 @@ import LxHeader from "@/components/LxHeader/index.vue";
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";
import assetsHistoryList from '@/views/assets/assetsHistoryList.vue'
export default {
name: 'tableList',
components: {
LxHeader,
dialoger,
@ -334,8 +335,8 @@ export default {
drawer,
imports,
assetsHistory,
atlas
atlas,
assetsHistoryList
},
mixins: [authMixin],
provide: {

Loading…
Cancel
Save