Commit 596e79e2 authored by 仇晓婷's avatar 仇晓婷

文档

parent 59c761c8
......@@ -54,7 +54,7 @@ export default {
},
data() {
return {
inputShow: true,
inputShow: true, //隐藏input
file: null,
name: this.value,
downUrl: fileUrlDown,
......
......@@ -1744,7 +1744,7 @@ export default {
status:'状态',
creator:'创建人',
remark:'备注',
url:'模板路径',
url:'上传模板',
},
document_ref:{
creationTime:'创建时间',
......
......@@ -58,10 +58,26 @@
</FormItem>
</Col>
<Col :span="24">
<Col :span="12">
<FormItem :label="l('template')" prop="template">
<!-- <Input v-model="entity.template" type="textarea" :rows="5"></Input> -->
<inputFile
class="tphoto"
ref="refmovieFile1"
v-model="imgName"
:parms="parmsName"
files
/>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('template')" prop="template">
<!-- <Input v-model="entity.template" type="textarea" :rows="5"></Input> -->
<files ref="refFile" :parms="parms" files />
<Select v-model="template" @on-select-change="setTemplate">
<Option v-for="(t, i) in templates" :key="i" :value="t.id">{{
t.name
}}</Option>
</Select>
</FormItem>
</Col>
<!-- <Col :span="24">
......@@ -164,7 +180,11 @@ export default {
name: "Add",
data() {
return {
imgName: "",
parmsName: "app=material&eid=1&name=documentTemplate",
codeList: [],
temlplates: [],
template: null,
entity: {
creatorUserId: this.$store.state.userInfo.userId,
name: "",
......@@ -318,7 +338,7 @@ export default {
},
mounted() {
this.tebleSet();
// console.log(this.row);
this.loadTemplate();
this.parms.eid = this.$u.guid();
this.$refs.refFile.intFiles();
},
......@@ -330,6 +350,19 @@ export default {
}
});
},
loadTemplate() {
let data = {
pageIndex: 1,
pageSize: 100,
conditions: [],
};
Api.filesList(data).then((r) => {
if (r.result) {
// this.templates = r.result;
}
});
},
setTemplate() {},
addNew() {
let maxId = 0;
this.checkList.map((u) => {
......@@ -371,7 +404,13 @@ export default {
this.$refs.form.validate((v) => {
if (v) {
if (this.$refs.refFile.nameList.length > 0) {
let nameList = this.$refs.refFile.nameList;
let names = [];
nameList.forEach((e) => {
names.push(e.fileName);
});
this.entity.templateId = this.parms.eid;
this.entity.template = names.join(",");
} else {
// this.entity.filePath = "";
this.entity.templateId = "";
......
......@@ -27,5 +27,7 @@ export default {
getChildren(params){
return Api.get(`${systemUrl}/Dictionary/getChildren`,params); //字典
},
filesList(params){
return Api.post(`${material}/documenttemplate/paged`,params);//模板列表里获取上传列表
},
}
\ No newline at end of file
......@@ -58,7 +58,18 @@
<Input v-model="entity.description" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('template')" prop="template">
<!-- <Input v-model="entity.template" type="textarea" :rows="5"></Input> -->
<inputFile
class="tphoto"
ref="refmovieFile1"
v-model="imgName"
:parms="parmsName"
files
/>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('template')" prop="templateId">
<!-- <Input v-model="entity.template" type="textarea" :rows="5"></Input> -->
......@@ -70,7 +81,7 @@
<Input v-model="entity.templateId"></Input>
</FormItem>
</Col>-->
<Col :span="24" v-if="inherit==0">
<Col :span="24" v-if="inherit == 0">
<Divider orientation="left">扩展属性</Divider>
<Table :columns="columns" :data="checkList" border>
<template slot-scope="{ row, index }" slot="title">
......@@ -165,7 +176,9 @@ export default {
name: "Edit",
data() {
return {
disabled: false,
imgName: "",
parmsName: "app=material&eid=1&name=documentTemplate",
codeList: [],
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
......@@ -303,11 +316,19 @@ export default {
eid: Number,
},
mounted() {
this.tebleSet();
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: {
tebleSet() {
Api.getChildren({ id: 582 }).then((r) => {
if (r.result) {
this.codeList = r.result;
}
});
},
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
......
......@@ -290,7 +290,7 @@ export default {
this.entity = r.result;
this.avatorPath = fileUrlDown + r.result.img;
this.imgName = r.result.img;
this.entity.status = r.result.status ;
this.entity.status = r.result.status;
if (r.result.filePath && r.result.filePath != "") {
this.parms.eid = r.result.filePath;
} else {
......
......@@ -43,7 +43,11 @@
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary code="word_template_status" v-model="entity.status" type="radio"></Dictionary>
<Dictionary
code="word_template_status"
v-model="entity.status"
type="radio"
></Dictionary>
</FormItem>
</Col>
<!-- <Col :span="12">
......@@ -51,10 +55,16 @@
<Input v-model="entity.creator"></Input>
</FormItem>
</Col>-->
<Col :span="24">
<Col :span="12">
<FormItem :label="l('url')" prop="url">
<!-- <InputFile v-model="entity.url"></InputFile> -->
<files ref="refFile" :parms="parms" files />
<inputFile
class="tphoto"
ref="refmovieFile1"
v-model="imgName"
:parms="parmsName"
files
/>
<!-- <files ref="refFile" :parms="parms" files /> -->
</FormItem>
</Col>
<Col :span="24">
......@@ -75,24 +85,20 @@ export default {
name: "Add",
data() {
return {
disabled: false,
imgName: "",
entity: {
creatorUserId: this.$store.state.userInfo.userId,
name: "",
status: 1,
creator: "",
remark: "",
url: "",
template: "", //上传名称
templateId: "", //上传id
},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
},
parms: {
app: "material",
eid: null,
name: "",
field: "",
},
parmsName: "app=material&eid=1&name=documentTemplate",
};
},
props: {
......@@ -100,18 +106,18 @@ export default {
eid: Number,
},
mounted() {
this.parms.eid = this.$u.guid();
this.$refs.refFile.intFiles();
// this.parms.eid = this.$u.guid();
// this.$refs.refFile.intFiles();
},
methods: {
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
if (this.$refs.refFile.nameList.length > 0) {
this.entity.url = this.parms.eid;
} else {
this.entity.url = "";
}
// if (this.$refs.refFile.nameList.length > 0) {
// this.entity.url = this.parms.eid;
// } else {
// this.entity.url = "";
// }
Api.create(this.entity)
.then((r) => {
if (r.success) {
......@@ -137,6 +143,14 @@ export default {
return this.$t(key);
},
},
watch: {},
watch: {
imgName(newName, oldName) {
if (newName != "") {
const imgPathsArr = JSON.parse(newName);
this.entity.templateId = imgPathsArr[0].filePath;
this.entity.template = imgPathsArr[0].fileName;
}
},
},
};
</script>
\ No newline at end of file
......@@ -43,7 +43,11 @@
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary code="word_template_status" v-model="entity.status" type="radio"></Dictionary>
<Dictionary
code="word_template_status"
v-model="entity.status"
type="radio"
></Dictionary>
</FormItem>
</Col>
<!-- <Col :span="12">
......@@ -51,9 +55,15 @@
<Input v-model="entity.creator"></Input>
</FormItem>
</Col>-->
<Col :span="24">
<Col :span="12">
<FormItem :label="l('url')" prop="url">
<files ref="refFile" :parms="parms" files />
<inputFile
class="tphoto"
ref="refmovieFile1"
v-model="imgName"
:parms="parmsName"
files
/>
</FormItem>
</Col>
<Col :span="24">
......@@ -74,17 +84,12 @@ export default {
name: "Edit",
data() {
return {
disabled: false,
imgName: "",
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
},
parms: {
app: "material",
eid: null,
name: "",
field: "",
},
parmsName: "app=material&eid=1&name=documentTemplate",
};
},
props: {
......@@ -99,17 +104,12 @@ export default {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.parms.eid = r.result.url;
this.entity.imgName = r.result.templateId;
});
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
if (this.$refs.refFile.nameList.length > 0) {
this.entity.url = this.parms.eid;
} else {
this.entity.url = "";
}
Api.update(this.entity)
.then((r) => {
if (r.success) {
......@@ -135,6 +135,13 @@ export default {
},
},
watch: {
imgName(newName, oldName) {
if (newName != "") {
const imgPathsArr = JSON.parse(newName);
this.entity.templateId = imgPathsArr[0].filePath;
this.entity.template = imgPathsArr[0].fileName;
}
},
eid(v) {
if (v != 0) {
this.load(v);
......
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