Commit 01d30b78 authored by 仇晓婷's avatar 仇晓婷

多页签和修复文件预览

parent 523689f4
...@@ -12,7 +12,13 @@ ...@@ -12,7 +12,13 @@
type="text" type="text"
></state> ></state>
</Filed> </Filed>
<Filed :span="8" :name="l('repair_file_url')">{{formValidate.repair_file_url}}</Filed> <Filed :span="8" :name="l('repair_file_url')">
<a
v-if="formValidate.repair_file_url"
:href="url(formValidate.repair_file_url)"
target="_balck"
>下载</a>
</Filed>
<Filed :span="8" :name="l('supporting_file_name')">{{formValidate.supporting_file_name}}</Filed> <Filed :span="8" :name="l('supporting_file_name')">{{formValidate.supporting_file_name}}</Filed>
<Filed :span="8" :name="l('supporting_file_status')"> <Filed :span="8" :name="l('supporting_file_status')">
...@@ -22,7 +28,13 @@ ...@@ -22,7 +28,13 @@
type="text" type="text"
></state> ></state>
</Filed> </Filed>
<Filed :span="8" :name="l('supporting_file_url')">{{formValidate.supporting_file_ulr}}</Filed> <Filed :span="8" :name="l('supporting_file_url')">
<a
v-if="formValidate.supporting_file_ulr"
:href="url(formValidate.supporting_file_ulr)"
target="_balck"
>下载</a>
</Filed>
<Filed :span="8" :name="l('slicing_file_name')">{{formValidate.slicing_file_name}}</Filed> <Filed :span="8" :name="l('slicing_file_name')">{{formValidate.slicing_file_name}}</Filed>
<Filed :span="8" :name="l('slicing_file_status')"> <Filed :span="8" :name="l('slicing_file_status')">
<state <state
...@@ -31,57 +43,66 @@ ...@@ -31,57 +43,66 @@
type="text" type="text"
></state> ></state>
</Filed> </Filed>
<Filed :span="8" :name="l('slicing_file_url')">{{formValidate.slicing_file_url}}</Filed> <Filed :span="8" :name="l('slicing_file_url')">
<a
v-if="formValidate.slicing_file_url"
:href="url(formValidate.slicing_file_url)"
target="_balck"
>下载</a>
</Filed>
</Row> </Row>
</div> </div>
</template> </template>
<script> <script>
import Api from '../api' import Api from "../api";
export default { export default {
name: 'detail', name: "detail",
components: {}, components: {},
props: { props: {
idVal: { idVal: {
type: String, type: String,
default: '' default: ""
} }
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
data() { data() {
return { return {
formValidate: { formValidate: {
state: '' state: ""
} }
} };
}, },
created() { created() {
this.dataImmut = [] this.dataImmut = [];
this.dataMut = [] this.dataMut = [];
Api.get({ Id: this.idVal }).then((r) => { Api.get({ Id: this.idVal }).then(r => {
if (r.success) { if (r.success) {
let farmData = {} let farmData = {};
farmData = JSON.parse(r.result.formData) farmData = JSON.parse(r.result.formData);
console.log(farmData) console.log(farmData);
this.formValidate = farmData this.formValidate = farmData;
// let formStr = r.result.formData.replace(/\"/g, '"') // let formStr = r.result.formData.replace(/\"/g, '"')
// this.formValidate = JSON.parse(formStr)[0] // this.formValidate = JSON.parse(formStr)[0]
} else { } else {
this.$Message.error('加载失败') this.$Message.error("加载失败");
} }
}) });
}, },
methods: { methods: {
load(v) {}, load(v) {},
url(path) {
return fileUrlDown + path
},
l(key) { l(key) {
key = 'OrderDataReview' + '.' + key key = "OrderDataReview" + "." + key;
return this.$t(key) return this.$t(key);
} }
}, },
watch: {} watch: {}
} };
</script> </script>
<style lang="less"> <style lang="less">
.detail { .detail {
......
...@@ -12,7 +12,13 @@ ...@@ -12,7 +12,13 @@
type="text" type="text"
></state> ></state>
</Filed> </Filed>
<Filed :span="8" :name="l('slicing_file_url')">{{formValidate.slicing_file_url}}</Filed> <Filed :span="8" :name="l('slicing_file_url')">
<a
v-if="formValidate.slicing_file_url"
:href="url(formValidate.slicing_file_url)"
target="_balck"
>下载</a>
</Filed>
<Filed :span="8" :name="l('supporting_file_name')">{{formValidate.supporting_file_name}}</Filed> <Filed :span="8" :name="l('supporting_file_name')">{{formValidate.supporting_file_name}}</Filed>
<Filed :span="8" :name="l('supporting_file_status')"> <Filed :span="8" :name="l('supporting_file_status')">
<state <state
...@@ -21,7 +27,13 @@ ...@@ -21,7 +27,13 @@
type="text" type="text"
></state> ></state>
</Filed> </Filed>
<Filed :span="8" :name="l('repair_file_url')">{{formValidate.repair_file_url}}</Filed> <Filed :span="8" :name="l('repair_file_url')">
<a
v-if="formValidate.repair_file_url"
:href="url(formValidate.repair_file_url)"
target="_balck"
>下载</a>
</Filed>
<Filed :span="8" :name="l('slicing_file_name')">{{formValidate.slicing_file_name}}</Filed> <Filed :span="8" :name="l('slicing_file_name')">{{formValidate.slicing_file_name}}</Filed>
<Filed :span="8" :name="l('slicing_file_status')"> <Filed :span="8" :name="l('slicing_file_status')">
<state <state
...@@ -30,58 +42,67 @@ ...@@ -30,58 +42,67 @@
type="text" type="text"
></state> ></state>
</Filed> </Filed>
<Filed :span="8" :name="l('supporting_file_url')">{{formValidate.supporting_file_ulr}}</Filed> <Filed :span="8" :name="l('supporting_file_url')">
<a
v-if="formValidate.supporting_file_ulr"
:href="url(formValidate.supporting_file_ulr)"
target="_balck"
>下载</a>
</Filed>
</Row> </Row>
</div> </div>
</template> </template>
<script> <script>
import Api from '../api' import Api from "../api";
export default { export default {
name: 'detail', name: "detail",
components: {}, components: {},
props: { props: {
idVal: { idVal: {
type: String, type: String,
default: '' default: ""
} }
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
data() { data() {
return { return {
formValidate: { formValidate: {
state: '' state: ""
} }
} };
}, },
created() { created() {
this.dataImmut = [] this.dataImmut = [];
this.dataMut = [] this.dataMut = [];
Api.get({ Id: this.idVal }).then((r) => { Api.get({ Id: this.idVal }).then(r => {
// console.log(r) // console.log(r)
if (r.success) { if (r.success) {
let farmData = {} let farmData = {};
farmData = JSON.parse(r.result.formData) farmData = JSON.parse(r.result.formData);
console.log(farmData) console.log(farmData);
this.formValidate = farmData this.formValidate = farmData;
// let formStr = r.result.formData.replace(/\"/g, '"') // let formStr = r.result.formData.replace(/\"/g, '"')
// this.formValidate = JSON.parse(formStr)[0] // this.formValidate = JSON.parse(formStr)[0]
} else { } else {
this.$Message.error('加载失败') this.$Message.error("加载失败");
} }
}) });
}, },
methods: { methods: {
load(v) {}, load(v) {},
url(path) {
return fileUrlDown + path;
},
l(key) { l(key) {
key = 'OrderDataReview' + '.' + key key = "OrderDataReview" + "." + key;
return this.$t(key) return this.$t(key);
} }
}, },
watch: {} watch: {}
} };
</script> </script>
<style lang="less"> <style lang="less">
.detail { .detail {
......
...@@ -12,7 +12,13 @@ ...@@ -12,7 +12,13 @@
type="text" type="text"
></state> ></state>
</Filed> </Filed>
<Filed :span="8" :name="l('repair_file_url')">{{formValidate.repair_file_url}}</Filed> <Filed :span="8" :name="l('repair_file_url')">
<a
v-if="formValidate.repair_file_url"
:href="url(formValidate.repair_file_url)"
target="_balck"
>下载</a>
</Filed>
<Filed :span="8" :name="l('supporting_file_name')">{{formValidate.supporting_file_name}}</Filed> <Filed :span="8" :name="l('supporting_file_name')">{{formValidate.supporting_file_name}}</Filed>
<Filed :span="8" :name="l('supporting_file_status')"> <Filed :span="8" :name="l('supporting_file_status')">
...@@ -22,7 +28,13 @@ ...@@ -22,7 +28,13 @@
type="text" type="text"
></state> ></state>
</Filed> </Filed>
<Filed :span="8" :name="l('supporting_file_url')">{{formValidate.supporting_file_ulr}}</Filed> <Filed :span="8" :name="l('supporting_file_url')">
<a
v-if="formValidate.supporting_file_ulr"
:href="url(formValidate.supporting_file_ulr)"
target="_balck"
>下载</a>
</Filed>
<Filed :span="8" :name="l('slicing_file_name')">{{formValidate.slicing_file_name}}</Filed> <Filed :span="8" :name="l('slicing_file_name')">{{formValidate.slicing_file_name}}</Filed>
<Filed :span="8" :name="l('slicing_file_status')"> <Filed :span="8" :name="l('slicing_file_status')">
<state <state
...@@ -31,58 +43,67 @@ ...@@ -31,58 +43,67 @@
type="text" type="text"
></state> ></state>
</Filed> </Filed>
<Filed :span="8" :name="l('slicing_file_url')">{{formValidate.slicing_file_url}}</Filed> <Filed :span="8" :name="l('slicing_file_url')">
<a
v-if="formValidate.slicing_file_url"
:href="url(formValidate.slicing_file_url)"
target="_balck"
>下载</a>
</Filed>
</Row> </Row>
</div> </div>
</template> </template>
<script> <script>
import Api from '../api' import Api from "../api";
export default { export default {
name: 'detail', name: "detail",
components: {}, components: {},
props: { props: {
idVal: { idVal: {
type: String, type: String,
default: '' default: ""
} }
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
data() { data() {
return { return {
formValidate: { formValidate: {
state: '' state: ""
} }
} };
}, },
created() { created() {
this.dataImmut = [] this.dataImmut = [];
this.dataMut = [] this.dataMut = [];
Api.get({ Id: this.idVal }).then((r) => { Api.get({ Id: this.idVal }).then(r => {
console.log(r) console.log(r);
if (r.success) { if (r.success) {
let farmData = {} let farmData = {};
farmData = JSON.parse(r.result.formData) farmData = JSON.parse(r.result.formData);
console.log(farmData) console.log(farmData);
this.formValidate = farmData this.formValidate = farmData;
// let formStr = r.result.formData.replace(/\"/g, '"') // let formStr = r.result.formData.replace(/\"/g, '"')
// this.formValidate = JSON.parse(formStr)[0] // this.formValidate = JSON.parse(formStr)[0]
} else { } else {
this.$Message.error('加载失败') this.$Message.error("加载失败");
} }
}) });
}, },
methods: { methods: {
load(v) {}, load(v) {},
url(path) {
return fileUrlDown + path
},
l(key) { l(key) {
key = 'OrderDataReview' + '.' + key key = "OrderDataReview" + "." + key;
return this.$t(key) return this.$t(key);
} }
}, },
watch: {} watch: {}
} };
</script> </script>
<style lang="less"> <style lang="less">
.detail { .detail {
......
...@@ -270,9 +270,9 @@ export const actions = { ...@@ -270,9 +270,9 @@ export const actions = {
state.opened.splice(1, currentIndex - 1).forEach(({ name }) => commit('keepAliveRemove', name)); state.opened.splice(1, currentIndex - 1).forEach(({ name }) => commit('keepAliveRemove', name));
} }
if (state.opened.length == 2) { // if (state.opened.length == 2) {
state.opened.splice(0, 1); // state.opened.splice(0, 1);
} // }
state.current = pageAim; state.current = pageAim;
if ($nuxt.$router.fullPath !== pageAim) { if ($nuxt.$router.fullPath !== pageAim) {
$nuxt.$router.push(pageAim); $nuxt.$router.push(pageAim);
...@@ -329,9 +329,9 @@ export const actions = { ...@@ -329,9 +329,9 @@ export const actions = {
state.opened.splice(currentIndex + 1).forEach(({ name }) => commit('keepAliveRemove', name)); state.opened.splice(currentIndex + 1).forEach(({ name }) => commit('keepAliveRemove', name));
state.opened.splice(1, currentIndex - 1).forEach(({ name }) => commit('keepAliveRemove', name)); state.opened.splice(1, currentIndex - 1).forEach(({ name }) => commit('keepAliveRemove', name));
} }
if (state.opened.length == 2) { // if (state.opened.length == 2) {
state.opened.splice(0, 1); // state.opened.splice(0, 1);
} // }
// 设置新的页面 // 设置新的页面
state.current = pageAim; state.current = pageAim;
if ($nuxt.$router.fullPath !== pageAim) { if ($nuxt.$router.fullPath !== pageAim) {
...@@ -354,11 +354,11 @@ export const actions = { ...@@ -354,11 +354,11 @@ export const actions = {
// 持久化 // 持久化
await dispatch('opened2db'); await dispatch('opened2db');
// 关闭所有的标签页后需要判断一次现在是不是在首页 // 关闭所有的标签页后需要判断一次现在是不是在首页
// if ($nuxt.$router.name !== 'index') { if ($nuxt.$router.name !== 'index') {
// $nuxt.$router.push({ $nuxt.$router.push({
// name: 'index' name: 'index'
// }, () => { }); }, () => { });
// } }
// end // end
resolve(); resolve();
}); });
...@@ -386,9 +386,9 @@ export const mutations = { ...@@ -386,9 +386,9 @@ export const mutations = {
list.splice(index, 1); list.splice(index, 1);
state.keepAlive = list; state.keepAlive = list;
} }
if (state.opened.length == 2) { // if (state.opened.length == 2) {
state.opened.splice(0, 1); // state.opened.splice(0, 1);
} // }
}, },
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment