Commit 55ab96ec authored by 仇晓婷's avatar 仇晓婷

样式

parent a5ed601f
...@@ -73,14 +73,20 @@ export default { ...@@ -73,14 +73,20 @@ export default {
} }
}, },
}, },
// {
{ key: "level", title: this.l("level"), align: "center", high: true }, // key: "level",
{ // title: this.l("level"),
key: "totalDocument", // align: "center",
title: this.l("totalDocument"), // high: true,
align: "center", // hide: true,
width: 160, // },
}, // {
// key: "totalDocument",
// title: this.l("totalDocument"),
// align: "center",
// width: 160,
// hide: true,
// },
// { // {
// key: "tenantId", // key: "tenantId",
// title: this.l("tenantId"), // title: this.l("tenantId"),
...@@ -225,7 +231,7 @@ export default { ...@@ -225,7 +231,7 @@ export default {
}, },
add() { add() {
this.curId = 0; this.curId = 0;
this.row.id = ''; this.row.id = "";
this.title = "新增"; this.title = "新增";
this.detail = () => import("./add"); this.detail = () => import("./add");
this.modal = true; this.modal = true;
......
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="120"> <div>
<Row> <Form ref="form" :model="entity" :rules="rules" :label-width="120">
<Col span="18"> <Row>
<Row> <Col span="18">
<Col v-for="li in fileds" :key="li.field" :span="li.span"> <Row>
<FormItem :label="li.title" :prop="li.name"> <Col v-for="li in fileds" :key="li.field" :span="li.span">
<Input v-if="li.dataType==0" v-model="entity[li.field]" :disabled="li.field=='code'"></Input> <FormItem :label="li.title" :prop="li.name">
<InputNumber <Input
v-if="li.dataType==1||li.dataType==2" v-if="li.dataType==0"
v-model="entity[li.field]" v-model="entity[li.field]"
class="w100" :disabled="li.field=='code'"
></InputNumber> ></Input>
<Dictionary v-if="li.dataType==3" v-model="entity[li.field]" :code="li.note"></Dictionary> <InputNumber
<Input v-if="li.dataType==5" type="textarea" v-model="entity[li.filed]"></Input> v-if="li.dataType==1||li.dataType==2"
<DatePicker v-model="entity[li.field]"
v-if="li.dataType==4" class="w100"
v-model="entity[li.field]" ></InputNumber>
type="date" <Dictionary v-if="li.dataType==3" v-model="entity[li.field]" :code="li.note"></Dictionary>
:placeholder="'选择'+li.title" <Input v-if="li.dataType==5" type="textarea" v-model="entity[li.filed]"></Input>
></DatePicker> <DatePicker
<InputFile v-if="li.dataType==6" v-model="entity[li.field]"></InputFile> v-if="li.dataType==4"
<!-- <files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" /> --> v-model="entity[li.field]"
<InputFile v-if="li.dataType==7" v-model="entity[li.field]"></InputFile> type="date"
<Input v-if="li.dataType==8" type="textarea" v-model="entity[li.field]"></Input> :placeholder="'选择'+li.title"
<state ></DatePicker>
v-if="li.unitName&&(li.dataType==1||li.dataType==2)" <InputFile v-if="li.dataType==6" v-model="entity[li.field]"></InputFile>
:value="li.unitName" <!-- <files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" /> -->
code="material.main.unitName" <InputFile v-if="li.dataType==7" v-model="entity[li.field]"></InputFile>
type="tag" <Input v-if="li.dataType==8" type="textarea" v-model="entity[li.field]"></Input>
></state> <state
</FormItem> v-if="li.unitName&&(li.dataType==1||li.dataType==2)"
</Col> :value="li.unitName"
</Row> code="material.main.unitName"
<!-- <div> type="tag"
></state>
</FormItem>
</Col>
</Row>
<!-- <div>
<Divider orientation="left">扩展属性</Divider> <Divider orientation="left">扩展属性</Divider>
</div>--> </div>-->
<Row> <Row>
<!-- <Col :span="12"> <!-- <Col :span="12">
<FormItem :label="l('title')" prop="title"> <FormItem :label="l('title')" prop="title">
<Input v-model="entity.title"></Input> <Input v-model="entity.title"></Input>
</FormItem> </FormItem>
</Col>--> </Col>-->
<!-- <Col :span="12"> <!-- <Col :span="12">
<FormItem :label="l('field')" prop="field"> <FormItem :label="l('field')" prop="field">
<Input v-model="entity.field"></Input> <Input v-model="entity.field"></Input>
</FormItem> </FormItem>
...@@ -50,8 +55,8 @@ ...@@ -50,8 +55,8 @@
<FormItem :label="l('dataType')" prop="dataType"> <FormItem :label="l('dataType')" prop="dataType">
<InputNumber v-model="entity.dataType"></InputNumber> <InputNumber v-model="entity.dataType"></InputNumber>
</FormItem> </FormItem>
</Col>--> </Col>-->
<!-- <Col :span="12"> <!-- <Col :span="12">
<FormItem :label="l('dataLength')" prop="dataLength"> <FormItem :label="l('dataLength')" prop="dataLength">
<InputNumber v-model="entity.dataLength"></InputNumber> <InputNumber v-model="entity.dataLength"></InputNumber>
</FormItem> </FormItem>
...@@ -60,9 +65,9 @@ ...@@ -60,9 +65,9 @@
<FormItem :label="l('dictionaryId')" prop="dictionaryId"> <FormItem :label="l('dictionaryId')" prop="dictionaryId">
<InputNumber v-model="entity.dictionaryId"></InputNumber> <InputNumber v-model="entity.dictionaryId"></InputNumber>
</FormItem> </FormItem>
</Col>--> </Col>-->
<!-- <Col :span="12"> <!-- <Col :span="12">
<FormItem :label="l('unitName')" prop="unitName"> <FormItem :label="l('unitName')" prop="unitName">
<Input v-model="entity.unitName"></Input> <Input v-model="entity.unitName"></Input>
</FormItem> </FormItem>
...@@ -136,49 +141,59 @@ ...@@ -136,49 +141,59 @@
<FormItem :label="l('codeRuleId')" prop="codeRuleId"> <FormItem :label="l('codeRuleId')" prop="codeRuleId">
<InputNumber v-model="entity.codeRuleId"></InputNumber> <InputNumber v-model="entity.codeRuleId"></InputNumber>
</FormItem> </FormItem>
</Col>--> </Col>-->
<Col :span="24"> <Col :span="24">
<FormItem :label="l('filePath')" prop="filePath"> <FormItem :label="l('filePath')" prop="filePath">
<!-- <Input v-model="entity.template" type="textarea" :rows="5"></Input> --> <!-- <Input v-model="entity.template" type="textarea" :rows="5"></Input> -->
<files ref="refFile" :parms="parms" files /> <files ref="refFile" :parms="parms" files />
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('status')" prop="status"> <FormItem :label="l('status')" prop="status">
<RadioGroup v-model="entity.status"> <RadioGroup v-model="entity.status">
<Radio label="0">草稿</Radio> <Radio label="0">草稿</Radio>
<Radio label="1">送审</Radio> <Radio label="1">送审</Radio>
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
</Col> </Col>
<Col span="6"> <Col span="6">
<FormItem :label="l('img')" prop="img"> <FormItem :label="l('img')" prop="img">
<inputFile class="tphoto" ref="refmovieFile1" v-model="imgName" :parms="parmsName" /> <inputFile class="tphoto" ref="refmovieFile1" v-model="imgName" :parms="parmsName" />
</FormItem> </FormItem>
<div class="img-touxiang"> <div class="img-touxiang">
<img :src="avatorPath" v-if="imgName" /> <img :src="avatorPath" v-if="imgName" />
<img src="@/assets/images/files_header.png" v-else width="100%" height="100%" /> <img src="@/assets/images/files_header.png" v-else width="100%" height="100%" />
</div> </div>
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col :span="24" style="text-align: right;"> <Col :span="24" style="text-align: right;">
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
</Form> </Form>
<!-- <Modal v-model="modal" title="文档送审" footer-hide fullscreen :mask-closable="false">
<Submit :isId="isId" ref="submit" @on-close="close"></Submit>
</Modal>-->
</div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
// import Submit from "./submit";
export default { export default {
name: "Add", name: "Add",
components: {
// Submit,
},
data() { data() {
return { return {
// modal: false,
isId: "",
imgName: "", imgName: "",
avatorPath: "", avatorPath: "",
fileds: [], //扩展属性 fileds: [], //扩展属性
...@@ -270,6 +285,12 @@ export default { ...@@ -270,6 +285,12 @@ export default {
Api.create(this.entity) Api.create(this.entity)
.then((r) => { .then((r) => {
if (r.success) { if (r.success) {
// if (this.entity.status == 1) {
// this.modal = true;
// this.isId = r.result.id;
// } else {
// this.modal = false;
// }
this.$Message.success("保存成功"); this.$Message.success("保存成功");
this.$emit("on-ok"); this.$emit("on-ok");
} else { } else {
......
<template>
<div class=".detail-document">
<div class="body-document">
<h4>详细信息</h4>
<Row>
<Col span="20">
<div class="new-detail detail-d">
<Row>
<Filed v-for="li in fileds" :key="li.field" :span="li.span" :name="li.title+':'">
<State v-if="li.dataType==3" :code="li.note" :value="entity[li.field]" />
<div v-else-if="li.dataType==8">{{entity[li.field]}}</div>
<div v-else-if="li.dataType==5" v-html="entity[li.field]"></div>
<DTSpan v-else-if="li.dataType==4" :value="entity[li.field]" />
<span v-else>{{entity[li.field]}}</span>
<State
v-if="li.unitName&&(li.dataType==1||li.dataType==2)"
:code="li.note"
:value="entity[li.field]"
/>
</Filed>
</Row>
<Row class="filed-d">
<Filed :span="12" :name="l('creationTime')+':'">{{entity.creationTime}}</Filed>
<Filed :span="12" :name="l('creatorUserId')+':'">
<User :value="entity.creatorUserId" />
</Filed>
<Filed :span="12" :name="l('status')+':'">{{entity.status==0?'草稿':'送审'}}</Filed>
<Filed :span="24" :name="l('filePath')+':'">
<files ref="refFile" :parms="parms" :showList="false" />
</Filed>
</Row>
</div>
</Col>
<Col span="4" class="dcm-right">
<div class="img-touxiang">
<img :src="downUrl+avatorPath" v-if="avatorPath" />
<img src="@/assets/images/files_header.png" v-else width="100%" height="100%" />
</div>
</Col>
</Row>
</div>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "Add",
data() {
return {
avatorPath: "",
downUrl: fileUrlDown,
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }],
},
fileds: [],
parms: {
app: "material",
eid: null,
name: "",
field: "",
},
};
},
props: ["eid", "treeId"],
mounted() {
this.initFiled();
this.parms.eid = this.$u.guid();
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.parms.eid = r.result.filePath;
this.avatorPath = r.result.img;
this.$emit("on-load");
});
},
initFiled() {
Api.listbyid({
categoryId: this.treeId,
}).then((r) => {
if (r.result) {
let result = [];
result = r.result.definie.concat(r.result.inherit);
console.log(result);
this.fileds = result.filter(function (item) {
item.span = 6;
if (item.dataType > 4) {
item.span = 24;
}
delete item["id"];
// return item.fieldType != 1;
return item;
});
this.fileds.map((u) => {
let v = "";
if (u.dataType == 1 || u.dataType == 2) {
v = 0;
}
this.entity[u.field] = "";
this.$set(this.entity, u.filed, v);
});
}
if (this.eid) {
this.load(this.eid);
}
});
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "document_property_definition" + "." + key;
return this.$t(key);
},
},
watch: {
eid(v) {
if (v > 0) {
this.load(v);
}
},
},
};
</script>
<style lang="less">
.top-title {
// margin: 10px;
background: #fff;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
position: relative;
border-radius: 5px;
}
.body-document {
margin-top: 10px;
background: #fff;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
border-radius: 8px;
h4 {
height: 50px;
line-height: 50px;
background: #515a6e;
padding: 0 10px;
color: #f5f6fa;
border-radius: 5px 5px 0 0;
}
.img-touxiang {
width: 230px;
height: 230px;
float: right;
margin-top: 10px;
margin-right: 10px;
img {
width: 100%;
height: 100%;
border-radius: 5px;
}
}
.detail-d {
padding-left: 20px;
.filed-d {
border-top: 1px solid #e0e0e0;
}
}
}
.detail-document {
background-color: #f5f7f9 !important;
}
</style>
\ No newline at end of file
...@@ -47,7 +47,12 @@ ...@@ -47,7 +47,12 @@
</Col> </Col>
<Col span="17" class="c"> <Col span="17" class="c">
<div>版本:{{row.version}}</div> <div>版本:{{row.version}}</div>
<div>文档详细说明:{{row.description}}</div> <div>状态:{{ row.status == 0 ? "草稿" : "送审"}}</div>
<!-- <div>
创建人:
<User :value="row.creatorUserId" />
</div>-->
<div>时间:{{row.creationTime}}</div>
<p class="a-icon"> <p class="a-icon">
<a @click="edit(row.id)"> <a @click="edit(row.id)">
<Icon type="md-create" />编辑 <Icon type="md-create" />编辑
...@@ -103,68 +108,34 @@ export default { ...@@ -103,68 +108,34 @@ export default {
align: "left", align: "left",
high: true, high: true,
}, },
{ key: "name", title: this.l("title"), align: "left", high: true },
{ {
key: "title", key: "creationTime",
title: this.l("title"), title: this.l("creationTime"),
align: "left",
easy: true,
high: true,
},
{ key: "field", title: this.l("field"), align: "left", high: true },
{
key: "dataType",
title: this.l("dataType"),
align: "left",
high: true,
},
{
key: "dataLength",
title: this.l("dataLength"),
align: "left",
high: true,
},
{
key: "dictionaryId",
title: this.l("dictionaryId"),
align: "left",
high: true,
},
{ key: "note", title: this.l("note"), align: "left", high: true },
{
key: "unitName",
title: this.l("unitName"),
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
}, },
{ key: "tag", title: this.l("tag"), align: "left", high: true },
{
key: "categoryId",
title: this.l("categoryId"),
align: "left",
high: true,
},
{ {
key: "required", key: "code",
title: this.l("required"), title: this.l("name"),
align: "left", align: "left",
high: true, high: true,
}, },
{ {
key: "isUnique", key: "status",
title: this.l("isUnique"), title: this.l("status"),
align: "left", align: "left",
high: true, high: true,
render: (h, params) => {
return h("div", [
h("span", params.row.status == 0 ? "草稿" : "送审"),
]);
},
}, },
{ {
key: "fieldType", key: "version",
title: this.l("fieldType"), title: this.l("revision"),
align: "left",
high: true,
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "left", align: "left",
high: true, high: true,
}, },
...@@ -173,49 +144,7 @@ export default { ...@@ -173,49 +144,7 @@ export default {
title: this.l("creatorUserId"), title: this.l("creatorUserId"),
align: "left", align: "left",
high: true, high: true,
}, type: "user",
{
key: "lastModificationTime",
title: this.l("lastModificationTime"),
align: "left",
high: true,
},
{
key: "lastModifierUserId",
title: this.l("lastModifierUserId"),
align: "left",
high: true,
},
{
key: "isDeleted",
title: this.l("isDeleted"),
align: "left",
high: true,
},
{
key: "deletionTime",
title: this.l("deletionTime"),
align: "left",
high: true,
},
{
key: "deleterUserId",
title: this.l("deleterUserId"),
align: "left",
high: true,
},
{
key: "dictionaryCode",
title: this.l("dictionaryCode"),
align: "left",
easy: true,
high: true,
},
{
key: "codeRuleId",
title: this.l("codeRuleId"),
align: "left",
high: true,
}, },
{ {
title: "操作", title: "操作",
...@@ -425,7 +354,7 @@ export default { ...@@ -425,7 +354,7 @@ export default {
.a-icon { .a-icon {
text-align: right; text-align: right;
margin-top: 25px; margin-top: 10px;
} }
} }
} }
......
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