Commit 19ead9e3 authored by renjintao's avatar renjintao

tech

parent 7a9b0d11
......@@ -550,6 +550,7 @@ export default {
position: relative;
height: 100%;
.table-tools {
padding-top: 5px;
height: 50px;
overflow: hidden;
.table-search {
......
......@@ -46,7 +46,8 @@
<FormItem :label="l('departmentId')" prop="departmentId">
<departmentSelect v-model="entity.departmentId"></departmentSelect>
</FormItem>
</Col> <Col :span="5">
</Col>
<Col :span="5">
<FormItem :label="l('isMain')" prop="isMain">
<Dictionary code="Process.state" v-model="entity.isMain" type="radio"></Dictionary>
</FormItem>
......@@ -61,7 +62,7 @@
<Dictionary code="Process.Status" v-model="entity.isEffect" type="radio"></Dictionary>
</FormItem>
</Col>
<!--
<!--
<Col :span="12">
<FormItem :label="l('upId')" prop="upId">
<InputNumber v-model="entity.upId"></InputNumber>
......@@ -121,23 +122,16 @@
</FormItem>
</Col>-->
<Col :span="24">
<FormItem :label="l('remark')" prop="remark">
<i-quill
v-model="entity.remark"
:height="300"
border
v-paste="handleImg"
/>
<FormItem :label="l('remark')" prop="remark">
<i-quill v-model="entity.remark" :height="300" border v-paste="handleImg" />
</FormItem>
</Col>
<Col :span="24">
<FormItem label="多媒体附件" prop="files">
<files />
<Col :span="24">
<FormItem label="多媒体附件" prop="files">
<files ref="refFile" :parms="parms" files />
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
......@@ -147,10 +141,10 @@
</template>
<script>
import Api from "./api";
import iQuill from '@/components/quill'
import iQuill from "@/components/quill";
export default {
name: "Add",
components: {
components: {
iQuill
// VueUeditorWrap
},
......@@ -186,6 +180,12 @@ export default {
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }]
},
parms: {
app: "technology",
eid: null,
name: "",
field: ""
}
};
},
......@@ -194,15 +194,27 @@ export default {
eid: Number
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
this.parms.eid = this.$u.guid();
this.$refs.refFile.intFiles();
},
methods: {
handleSubmit() {
this.$refs.form.validate(v => {
if (v) {
this.disabled = true;
// this.entity.qualityTemplateName = ''
// this.entity.qualityTemplate=''
// if (this.$refs.refFile.nameList.length > 0) {
// let nameList=this.$refs.refFile.nameList
// let names=[]
// let url=[]
// nameList.forEach(e => {
// names.push(e.fileName)
// url.push(e.filePath)
// });
// this.entity.qualityTemplateName = JSON.stringify(names).replace('[','').replace(']','').replace(/\"/g,'')//附件本地库暂存文件名称
// this.entity.qualityTemplate=JSON.stringify(url).replace('[','').replace(']','').replace(/\"/g,'')
// }
Api.create(this.entity)
.then(r => {
this.disabled = false;
......@@ -224,23 +236,23 @@ export default {
handleClose() {
this.$emit("on-close");
},
handleImg(e) {
console.warn(e)
let file = null
handleImg(e) {
console.warn(e);
let file = null;
if (
e.clipboardData &&
e.clipboardData.items[0] &&
e.clipboardData.items[0].type &&
e.clipboardData.items[0].type.indexOf('image') > -1
e.clipboardData.items[0].type.indexOf("image") > -1
) {
//这里就是判断是否有粘贴进来的文件且文件为图片格式
file = e.clipboardData.items[0].getAsFile()
let reader = new FileReader()
reader.readAsDataURL(file)
file = e.clipboardData.items[0].getAsFile();
let reader = new FileReader();
reader.readAsDataURL(file);
setTimeout(() => {
var img = '<img src="' + reader.result + '" alt=""/>'
this.entity.remark += img
}, 1000)
var img = '<img src="' + reader.result + '" alt=""/>';
this.entity.remark += img;
}, 1000);
// new R
}
......
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