Commit 146db3e9 authored by renjintao's avatar renjintao

Merge branch 'product' of git.mes123.com:zhouyx/mes-ui into product-rjt

parents 8f87ce01 f28c5af8
<template>
<div>
<Input v-model="newName" placeholder="请选择上传文件">
<Button v-if="view" icon="ios-eye" slot="prepend" @click="downFile(newName)"> </Button>
<Button type="primary" icon="ios-cloud-upload-outline" slot="append" @click="handler">上传</Button>
<Input v-model="newName" placeholder="请选择上传文件" v-if="inputShow">
<Button
v-if="view"
icon="ios-eye"
slot="prepend"
@click="downFile(newName)"
>
</Button>
<Button
type="primary"
icon="ios-cloud-upload-outline"
slot="append"
@click="handler"
>上传</Button
>
</Input>
<Button
v-else
type="primary"
icon="ios-cloud-upload-outline"
slot="append"
@click="handler"
>上传</Button
>
<Upload
v-model="name"
:action="postUrl"
......@@ -18,8 +38,9 @@
:files="files"
:on-progress="onProgress"
>
<Button v-show="1==2" type="primary" ref="upload">上传</Button>
<Button v-show="1 == 2" type="primary" ref="upload">上传</Button>
</Upload>
<Progress :percent="per" :stroke-width="5" v-show="vshowPro" />
</div>
</template>
......@@ -29,10 +50,11 @@ export default {
name: "inputFile",
model: {
prop: "value",
event: "on-change"
event: "on-change",
},
data() {
return {
inputShow: true,
file: null,
name: this.value,
downUrl: fileUrlDown,
......@@ -48,7 +70,7 @@ export default {
newName: "",
newPath: "",
per: 0,
vshowPro: false
vshowPro: false,
};
},
created() {},
......@@ -56,20 +78,20 @@ export default {
value: [String, Number, Array, Object],
maxSize: {
type: Number,
default: 10240
default: 10240,
},
files: {
type: Boolean,
default: false
default: false,
},
parms: {
type: String,
default: ""
default: "",
},
showButton: {
type: Boolean,
default: true
}
default: true,
},
},
methods: {
onProgress(event, file, fileList) {
......@@ -138,7 +160,7 @@ export default {
"jpg",
"gif",
"zip",
"rar"
"rar",
];
}
return this.formatList;
......@@ -156,7 +178,7 @@ export default {
window.open(this.fileUrlPath, "_blank");
}
}
}
},
},
mounted() {
this.formatL();
......@@ -165,15 +187,15 @@ export default {
nativeInputValue() {
return this.value === null || this.value === undefined ? "" : this.value;
},
view(){
return true
}
view() {
return true;
},
},
watch: {
value(v) {
this.name = v;
}
}
},
},
};
</script>
<style lang="less">
......
......@@ -1773,6 +1773,7 @@ export default {
miji:"密级",
status:'状态',
filePath:'上传文件',
img:'上传图片',
field:'字段',
dataType:'数据类型',
dataLength:'数据长度',
......
......@@ -144,6 +144,7 @@ export default {
if (this.eid > 0) {
this.load(this.eid);
}
this.parms.eid = this.$u.guid();
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
......@@ -192,6 +193,13 @@ export default {
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
if (this.$refs.refFile.nameList.length > 0) {
this.entity.productUrlList = this.parms.eid;
} else {
this.entity.productUrl = "";
this.entity.productUrlList = "";
}
Api.update(this.entity)
.then((r) => {
if (r.success) {
......
......@@ -437,7 +437,7 @@ export default {
.product-m {
.body-card {
border: 1px solid rgba(38, 128, 235, 1);
margin: 10px;
margin: 8px 0;
border-radius: 4px;
.title-i {
......
......@@ -13,7 +13,10 @@
</Col>-->
<Col :span="12">
<FormItem :label="l('type')" prop="type">
<Dictionary code="word_classification_type" v-model="entity.type"></Dictionary>
<Dictionary
code="word_classification_type"
v-model="entity.type"
></Dictionary>
<!-- <InputNumber v-model="entity.type"></InputNumber> -->
</FormItem>
</Col>
......@@ -29,12 +32,19 @@
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary code="word_classification_status" v-model="entity.status"></Dictionary>
<Dictionary
code="word_classification_status"
v-model="entity.status"
></Dictionary>
<!-- <InputNumber v-model="entity.status"></InputNumber> -->
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('inheritCategoryId')" prop="inheritCategoryId" v-if="row.id">
<FormItem
:label="l('inheritCategoryId')"
prop="inheritCategoryId"
v-if="row.id"
>
<!-- <Checkbox v-model="entity.inheritCategoryId"></Checkbox> -->
<RadioGroup v-model="inherit">
<Radio label="1"></Radio>
......@@ -59,34 +69,41 @@
<Input v-model="entity.templateId"></Input>
</FormItem>
</Col>-->
<Col :span="24">
<Col :span="24" v-if="inherit==0">
<Divider orientation="left">扩展属性</Divider>
<Table :columns="columns" :data="checkList" border>
<template slot-scope="{ row, index }" slot="title">
<div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div>
<div v-if="row.fieldType == 1 || row.fieldType == 2">
{{ row.title }}
</div>
<Input
v-model="row.title"
placeholder="请输入名称"
@on-blur="setRow(row,index)"
v-if="row.fieldType==3"
@on-blur="setRow(row, index)"
v-if="row.fieldType == 3"
/>
</template>
<template slot-scope="{ row, index }" slot="note">
<!-- <Input v-if="row.dataType==3" v-model="row.note" placeholder="请输入字典编码" @on-blur="setRow(row,index)" /> -->
<Select
v-if="row.dataType==3"
v-if="row.dataType == 3"
v-model="row.note"
clearable
transfer
@on-change="setRow(row,index)"
@on-change="setRow(row, index)"
>
<Option
v-for="item in codeList"
:value="item.code"
:key="item.code"
>{{ item.name }}</Option
>
<Option v-for="item in codeList" :value="item.code" :key="item.code">{{ item.name }}</Option>
</Select>
<span v-else>{{row.note}}</span>
<span v-else>{{ row.note }}</span>
</template>
<template slot-scope="{ row, index }" slot="dataType">
<Dictionary
@on-change="setRow(row,index)"
@on-change="setRow(row, index)"
v-model="row.dataType"
code="materail.category.dataType"
type="select"
......@@ -96,8 +113,8 @@
</template>
<template slot-scope="{ row, index }" slot="unitName">
<Dictionary
v-if="row.dataType==1||row.dataType==2"
@on-change="setRow(row,index)"
v-if="row.dataType == 1 || row.dataType == 2"
@on-change="setRow(row, index)"
v-model="row.unitName"
code="material.main.unitName"
type="select"
......@@ -107,17 +124,30 @@
></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="required">
<Checkbox v-model="row.required" @on-change="setRow(row,index)"></Checkbox>
<Checkbox
v-model="row.required"
@on-change="setRow(row, index)"
></Checkbox>
</template>
<template slot-scope="{ row, index }" slot="isUnique">
<Checkbox v-model="row.isUnique" @on-change="setRow(row,index)"></Checkbox>
<Checkbox
v-model="row.isUnique"
@on-change="setRow(row, index)"
></Checkbox>
</template>
<template slot-scope="{ row, index }" slot="action">
<a @click="remove(index,row)" style="color:#FF7A8B" v-if="row.fieldType>1">删除</a>
<a
@click="remove(index, row)"
style="color: #ff7a8b"
v-if="row.fieldType > 1"
>删除</a
>
</template>
</Table>
<Button type="dashed" long @click="addNew" class="mt10">新增属性</Button>
<Button type="dashed" long @click="addNew" class="mt10"
>新增属性</Button
>
</Col>
<Col :span="24" class="tr mt10">
<FormItem>
......@@ -181,6 +211,19 @@ export default {
action: 1,
add: 0, //新增标识
},
{
field: "secret",
title: "密级",
note: "",
dataType: 3,
unitName: "",
required: true,
isunique: false,
fieldType: 1,
categoryId: 0,
action: 1,
add: 0, //新增标识
},
{
field: "name",
title: "标题",
......@@ -198,7 +241,7 @@ export default {
field: "description",
title: "文档详细说明",
note: "",
dataType: 0,
dataType: 8,
unitName: "",
required: true,
isunique: false,
......
......@@ -14,7 +14,10 @@
</Col>-->
<Col :span="12">
<FormItem :label="l('type')" prop="type">
<Dictionary code="word_classification_type" v-model="entity.type"></Dictionary>
<Dictionary
code="word_classification_type"
v-model="entity.type"
></Dictionary>
<!-- <InputNumber v-model="entity.type"></InputNumber> -->
</FormItem>
</Col>
......@@ -30,12 +33,19 @@
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary code="word_classification_status" v-model="entity.status"></Dictionary>
<Dictionary
code="word_classification_status"
v-model="entity.status"
></Dictionary>
<!-- <InputNumber v-model="entity.status"></InputNumber> -->
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('inheritCategoryId')" prop="inheritCategoryId" v-if='entity.upId!=0'>
<FormItem
:label="l('inheritCategoryId')"
prop="inheritCategoryId"
v-if="entity.upId != 0"
>
<!-- <Checkbox v-model="entity.inheritCategoryId"></Checkbox> -->
<RadioGroup v-model="inherit">
<Radio label="1"></Radio>
......@@ -60,34 +70,41 @@
<Input v-model="entity.templateId"></Input>
</FormItem>
</Col>-->
<Col :span="24">
<Col :span="24" v-if="inherit==0">
<Divider orientation="left">扩展属性</Divider>
<Table :columns="columns" :data="checkList" border>
<template slot-scope="{ row, index }" slot="title">
<div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div>
<div v-if="row.fieldType == 1 || row.fieldType == 2">
{{ row.title }}
</div>
<Input
v-model="row.title"
placeholder="请输入名称"
@on-blur="setRow(row,index)"
v-if="row.fieldType==3"
@on-blur="setRow(row, index)"
v-if="row.fieldType == 3"
/>
</template>
<template slot-scope="{ row, index }" slot="note">
<!-- <Input v-if="row.dataType==3" v-model="row.note" placeholder="请输入字典编码" @on-blur="setRow(row,index)" /> -->
<Select
v-if="row.dataType==3"
v-if="row.dataType == 3"
v-model="row.note"
clearable
transfer
@on-change="setRow(row,index)"
@on-change="setRow(row, index)"
>
<Option
v-for="item in codeList"
:value="item.code"
:key="item.code"
>{{ item.name }}</Option
>
<Option v-for="item in codeList" :value="item.code" :key="item.code">{{ item.name }}</Option>
</Select>
<span v-else>{{row.note}}</span>
<span v-else>{{ row.note }}</span>
</template>
<template slot-scope="{ row, index }" slot="dataType">
<Dictionary
@on-change="setRow(row,index)"
@on-change="setRow(row, index)"
v-model="row.dataType"
code="materail.category.dataType"
type="select"
......@@ -97,8 +114,8 @@
</template>
<template slot-scope="{ row, index }" slot="unitName">
<Dictionary
v-if="row.dataType==1||row.dataType==2"
@on-change="setRow(row,index)"
v-if="row.dataType == 1 || row.dataType == 2"
@on-change="setRow(row, index)"
v-model="row.unitName"
code="material.main.unitName"
type="select"
......@@ -108,17 +125,30 @@
></Dictionary>
</template>
<template slot-scope="{ row, index }" slot="required">
<Checkbox v-model="row.required" @on-change="setRow(row,index)"></Checkbox>
<Checkbox
v-model="row.required"
@on-change="setRow(row, index)"
></Checkbox>
</template>
<template slot-scope="{ row, index }" slot="isUnique">
<Checkbox v-model="row.isUnique" @on-change="setRow(row,index)"></Checkbox>
<Checkbox
v-model="row.isUnique"
@on-change="setRow(row, index)"
></Checkbox>
</template>
<template slot-scope="{ row, index }" slot="action">
<a @click="remove(index,row)" style="color:#FF7A8B" v-if="row.fieldType>1">删除</a>
<a
@click="remove(index, row)"
style="color: #ff7a8b"
v-if="row.fieldType > 1"
>删除</a
>
</template>
</Table>
<Button type="dashed" long @click="addNew" class="mt10">新增属性</Button>
<Button type="dashed" long @click="addNew" class="mt10"
>新增属性</Button
>
</Col>
<Col :span="24" class="tr mt10">
<FormItem>
......@@ -168,6 +198,19 @@ export default {
action: 1,
add: 0, //新增标识
},
{
field: "secret",
title: "密级",
note: "",
dataType: 3,
unitName: "",
required: true,
isunique: false,
fieldType: 1,
categoryId: 0,
action: 1,
add: 0, //新增标识
},
{
field: "name",
title: "标题",
......@@ -185,7 +228,7 @@ export default {
field: "description",
title: "文档详细说明",
note: "",
dataType: 0,
dataType: 8,
unitName: "",
required: true,
isunique: false,
......
<template>
<div>
<div class="mb10 pt5">
<Input v-model.trim="searchValue" placeholder="请输入库位名称" clearable style="width: 240px" />
<Input
v-model.trim="searchValue"
placeholder="请输入库位名称"
clearable
style="width: 240px"
/>
<Button type="primary" class @click="handleSearch">查询</Button>
<div class="fr">
<Button type="primary" @click="add()">新增分类</Button>
......@@ -10,7 +15,13 @@
<TreeGrid :columns="columns" :items="treeData"></TreeGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" :row="row" />
<component
:is="detail"
:eid="curId"
@on-close="cancel"
@on-ok="ok"
:row="row"
/>
</Modal>
</div>
</template>
......@@ -53,34 +64,21 @@ export default {
easy: true,
high: true,
},
{
key: "creationTime",
title: this.l("creationTime"),
width: 180,
align: "center",
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
align: "center",
render: (h, params) => {
if (params.row.creatorUserId) {
return h("User", {
props: {
value: params.row.creatorUserId,
},
});
}
},
},
{ key: "level", title: this.l("level"), align: "center", high: true },
{
key: "totalDocument",
title: this.l("totalDocument"),
align: "center",
width: 160,
},
// {
// key: "level",
// title: this.l("level"),
// align: "center",
// high: true,
// hide: true,
// },
// {
// key: "totalDocument",
// title: this.l("totalDocument"),
// align: "center",
// width: 160,
// hide: true,
// },
// {
// key: "tenantId",
// title: this.l("tenantId"),
......@@ -101,6 +99,7 @@ export default {
align: "left",
easy: true,
high: true,
width: 300,
},
{
key: "englishName",
......@@ -116,21 +115,44 @@ export default {
high: true,
code: "word_classification_status",
},
// {
// key: "inheritCategoryId",
// title: this.l("inheritCategoryId"),
// align: "center",
// high: true,
// hide: true,
// render: (h, params) => {
// return h("div", [
// h("span", params.row.inheritCategoryId == 0 ? "否" : "是"),
// ]);
// },
// },
{
key: "inheritCategoryId",
title: this.l("inheritCategoryId"),
key: "description",
title: this.l("description"),
align: "left",
width: 200,
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
align: "center",
high: true,
render: (h, params) => {
return h("div", [
h("span", params.row.inheritCategoryId == 0 ? "否" : "是"),
]);
if (params.row.creatorUserId) {
return h("User", {
props: {
value: params.row.creatorUserId,
},
});
}
},
},
{
key: "description",
title: this.l("description"),
align: "left",
key: "creationTime",
title: this.l("creationTime"),
width: 200,
align: "center",
},
{
title: "操作",
......@@ -225,7 +247,7 @@ export default {
},
add() {
this.curId = 0;
this.row.id = '';
this.row.id = "";
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
......
<template>
<div>
<Form ref="form" :model="entity" :rules="rules" :label-width="120">
<Row>
<Col span="18">
<Row>
<Col v-for="li in fileds" :key="li.field" :span="li.span">
<FormItem :label="li.title" :prop="li.name">
<Input v-if="li.dataType==0" v-model="entity[li.field]" :disabled="li.field=='code'"></Input>
<Input
v-if="li.dataType == 0"
v-model="entity[li.field]"
:disabled="li.field == 'code'"
:placeholder="
li.field == 'code' ? '保存后编号将自动生成' : ''
"
></Input>
<InputNumber
v-if="li.dataType==1||li.dataType==2"
v-if="li.dataType == 1 || li.dataType == 2"
v-model="entity[li.field]"
class="w100"
></InputNumber>
<Dictionary v-if="li.dataType==3" v-model="entity[li.field]" :code="li.note"></Dictionary>
<Input v-if="li.dataType==5" type="textarea" v-model="entity[li.filed]"></Input>
<Dictionary
v-if="li.dataType == 3"
v-model="entity[li.field]"
:code="li.note"
></Dictionary>
<Input
v-if="li.dataType == 5"
type="textarea"
v-model="entity[li.filed]"
></Input>
<DatePicker
v-if="li.dataType==4"
v-if="li.dataType == 4"
v-model="entity[li.field]"
type="date"
:placeholder="'选择'+li.title"
:placeholder="'选择' + li.title"
></DatePicker>
<InputFile v-if="li.dataType==6" v-model="entity[li.field]"></InputFile>
<InputFile
v-if="li.dataType == 6"
v-model="entity[li.field]"
></InputFile>
<!-- <files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" /> -->
<InputFile v-if="li.dataType==7" v-model="entity[li.field]"></InputFile>
<Input v-if="li.dataType==8" type="textarea" v-model="entity[li.field]"></Input>
<InputFile
v-if="li.dataType == 7"
v-model="entity[li.field]"
></InputFile>
<Input
v-if="li.dataType == 8"
type="textarea"
v-model="entity[li.field]"
></Input>
<state
v-if="li.unitName&&(li.dataType==1||li.dataType==2)"
v-if="li.unitName && (li.dataType == 1 || li.dataType == 2)"
:value="li.unitName"
code="material.main.unitName"
type="tag"
......@@ -60,12 +88,6 @@
</FormItem>
</Col>-->
<Col :span="24">
<FormItem :label="l('filePath')" prop="filePath">
<!-- <Input v-model="entity.template" type="textarea" :rows="5"></Input> -->
<files ref="refFile" :parms="parms" files />
</FormItem>
</Col>
<!-- <Col :span="12">
<FormItem :label="l('unitName')" prop="unitName">
<Input v-model="entity.unitName"></Input>
......@@ -141,19 +163,53 @@
<InputNumber v-model="entity.codeRuleId"></InputNumber>
</FormItem>
</Col>-->
<Col :span="24">
<FormItem :label="l('filePath')" prop="filePath">
<!-- <Input v-model="entity.template" type="textarea" :rows="5"></Input> -->
<files ref="refFile" :parms="parms" files />
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<RadioGroup v-model="entity.status">
<Dictionary
code="word.document.status"
v-model="entity.status"
></Dictionary>
<!-- <RadioGroup v-model="entity.status">
<Radio label="0">草稿</Radio>
<Radio label="1">送审</Radio>
</RadioGroup>
</RadioGroup> -->
</FormItem>
</Col>
<!-- <Col :span="24">
<div v-html="entity"></div>
</Col>-->
<Col :span="24" style="text-align: right;">
</Row>
</Col>
<Col span="6">
<FormItem :label="l('img')" prop="img">
<inputFile
class="tphoto"
ref="refmovieFile1"
v-model="imgName"
:parms="parmsName"
/>
</FormItem>
<div class="img-touxiang">
<img
:src="avatorPath"
v-if="imgName"
@click="imgUrl"
class="img1"
/>
<img
src="@/assets/images/files_header.png"
v-else
width="100%"
height="100%"
/>
</div>
</Col>
</Row>
<Row>
<Col :span="24" style="text-align: right">
<FormItem>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
......@@ -161,19 +217,31 @@
</Col>
</Row>
</Form>
<!-- <Modal v-model="modal" title="文档送审" footer-hide fullscreen :mask-closable="false">
<Submit :isId="isId" ref="submit" @on-close="close"></Submit>
</Modal>-->
</div>
</template>
<script>
import Api from "./api";
// import Submit from "./submit";
export default {
name: "Add",
components: {
// Submit,
},
data() {
return {
disabled: false,
// modal: false,
isId: "",
imgName: "",
avatorPath: "",
fileds: [], //扩展属性
entity: {
creatorUserId: this.$store.state.userInfo.userId,
status: "0",
status: "",
categoryId: this.treeId,
img: "",
// title: "",
// field: "",
// dataType: null,
......@@ -199,6 +267,7 @@ export default {
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
},
parmsName: "app=material&eid=1&name=document",
parms: {
app: "material",
eid: null,
......@@ -210,32 +279,26 @@ export default {
props: {
v: Object,
treeId: Number,
eid: Number,
eid: String,
},
created() {},
mounted() {
this.initFiled();
this.parms.eid = this.$u.guid();
this.$refs.refFile.intFiles();
this.$refs.refmovieFile1.inputShow = false;
},
methods: {
imgUrl() {
window.open(this.avatorPath, "_blank");
},
initFiled() {
// let conditions = [
// {
// conditionalType: "Equal",
// fieldName: "categoryId",
// fieldValue: this.eid,
// },
// ];
Api.listbyid({
categoryId: this.treeId,
// sortBy: "id",
// isDesc: false,
}).then((r) => {
if (r.result) {
let result = [];
result = r.result.definie.concat(r.result.inherit);
console.log(result)
console.log(result);
this.fileds = result.filter(function (item) {
item.span = 12;
if (item.dataType > 4) {
......@@ -254,11 +317,17 @@ export default {
this.$set(this.entity, u.filed, v);
});
}
if (this.eid) {
this.load(this.eid);
}
});
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
if (this.entity.id) {
delete this.entity.id;
}
if (this.$refs.refFile.nameList.length > 0) {
this.entity.filePath = this.parms.eid;
} else {
......@@ -267,6 +336,12 @@ export default {
Api.create(this.entity)
.then((r) => {
if (r.success) {
// if (this.entity.status == 1) {
// this.modal = true;
// this.isId = r.result.id;
// } else {
// this.modal = false;
// }
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
......@@ -283,26 +358,53 @@ export default {
handleClose() {
this.$emit("on-close");
},
// load(v) {
// Api.get({ id: v }).then((r) => {
// this.entity = r.result;
// this.entity.id = 0;
// });
// },
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.avatorPath = fileUrlDown + r.result.img;
this.imgName = r.result.img;
this.entity.status = r.result.status;
if (r.result.filePath && r.result.filePath != "") {
this.parms.eid = r.result.filePath;
} else {
this.parms.eid = this.$u.guid();
}
this.entity.filePath = this.parms.eid;
});
},
l(key) {
key = "document_property_definition" + "." + key;
return this.$t(key);
},
},
watch: {
// v() {
// this.entity = this.$u.clone(this.v);
// },
// eid(v) {
// if (v > 0) {
// this.load(v);
// }
// },
eid(v) {
if (v) {
this.load(v);
}
},
imgName(newName, oldName) {
console.log(newName);
const imgPathsArr = JSON.parse(newName);
this.entity.img = imgPathsArr[0].filePath;
this.avatorPath = fileUrlDown + imgPathsArr[0].filePath;
},
},
};
</script>
<style lang="less">
.img-touxiang {
width: 230px;
height: 230px;
margin-left: 58px;
margin-top: -35px;
img {
width: 100%;
height: 100%;
border-radius: 5px;
}
.img1 {
cursor: pointer;
}
}
</style>
\ No newline at end of file
<template>
<div class="detail">
<div class=".detail-document">
<div class="top-title">
<div class="new-detail row-left">
<Row>
<Filed :span="12" :name="l('title')">{{entity.title}}</Filed>
<Filed :span="12" :name="l('field')">{{entity.field}}</Filed>
<Filed :span="12" :name="l('dataType')">{{entity.dataType}}</Filed>
<Filed :span="12" :name="l('dataLength')">{{entity.dataLength}}</Filed>
<Filed :span="12" :name="l('dictionaryId')">{{entity.dictionaryId}}</Filed>
<Filed :span="12" :name="l('note')">{{entity.note}}</Filed>
<Filed :span="12" :name="l('unitName')">{{entity.unitName}}</Filed>
<Filed :span="12" :name="l('tag')">{{entity.tag}}</Filed>
<Filed :span="12" :name="l('categoryId')">{{entity.categoryId}}</Filed>
<Filed :span="12" :name="l('required')">{{entity.required}}</Filed>
<Filed :span="12" :name="l('isUnique')">{{entity.isUnique}}</Filed>
<Filed :span="12" :name="l('fieldType')">{{entity.fieldType}}</Filed>
<Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="12" :name="l('creatorUserId')">{{entity.creatorUserId}}</Filed>
<Filed :span="12" :name="l('lastModificationTime')">{{entity.lastModificationTime}}</Filed>
<Filed :span="12" :name="l('lastModifierUserId')">{{entity.lastModifierUserId}}</Filed>
<Filed :span="12" :name="l('isDeleted')">{{entity.isDeleted}}</Filed>
<Filed :span="12" :name="l('deletionTime')">{{entity.deletionTime}}</Filed>
<Filed :span="12" :name="l('deleterUserId')">{{entity.deleterUserId}}</Filed>
<Filed :span="12" :name="l('dictionaryCode')">{{entity.dictionaryCode}}</Filed>
<Filed :span="12" :name="l('codeRuleId')">{{entity.codeRuleId}}</Filed>
<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') + ':'">
<state code="word.document.status" :value="entity.status" />
</Filed>
</Row>
</div>
<ul>
<li>
<a @click="edit"> <Icon type="md-create" />&nbsp;编辑 </a>
&nbsp;
<span>|</span>
</li>
<li>
<a> <Icon type="ios-log-in" />&nbsp;移动 </a>
&nbsp;
<span>|</span>
</li>
<li>
<a @click="copy"> <Icon type="ios-photos" />&nbsp;克隆 </a>
&nbsp;
<span>|</span>
</li>
<li>
<a> <Icon type="md-download" />&nbsp;下载 </a>
&nbsp;
<span>|</span>
</li>
<li>
<a> <Icon type="ios-link" />&nbsp;引用 </a>
&nbsp;
<span>|</span>
</li>
<li>
<a> <Icon type="md-checkmark-circle" />&nbsp;使用 </a>
&nbsp;
<span>|</span>
</li>
<li>
<a> <Icon type="ios-alert-outline" />版本 </a>
</li>
</ul>
</div>
<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>
<Filed :span="24" :name="l('filePath') + ':'" class="filed-d">
<files ref="refFile" :parms="parms" :showList="false" />
</Filed>
<!-- <Filed :span="12" :name="l('field')">{{entity.field}}</Filed>
<Filed :span="12" :name="l('dataType')">{{entity.dataType}}</Filed>
<Filed :span="12" :name="l('dataLength')">{{entity.dataLength}}</Filed>
<Filed :span="12" :name="l('dictionaryId')">{{entity.dictionaryId}}</Filed>
<Filed :span="12" :name="l('note')">{{entity.note}}</Filed>
<Filed :span="12" :name="l('unitName')">{{entity.unitName}}</Filed>
<Filed :span="12" :name="l('tag')">{{entity.tag}}</Filed>-->
<!-- <Filed :span="12" :name="l('categoryId')">{{entity.categoryId}}</Filed> -->
<!-- <Filed :span="12" :name="l('required')">{{entity.required}}</Filed>
<Filed :span="12" :name="l('isUnique')">{{entity.isUnique}}</Filed>-->
<!-- <Filed :span="12" :name="l('fieldType')">{{entity.fieldType}}</Filed> -->
<!-- <Filed :span="12" :name="l('lastModificationTime')">{{entity.lastModificationTime}}</Filed> -->
<!-- <Filed :span="12" :name="l('lastModifierUserId')">{{entity.lastModifierUserId}}</Filed>
<Filed :span="12" :name="l('isDeleted')">{{entity.isDeleted}}</Filed>
<Filed :span="12" :name="l('deletionTime')">{{entity.deletionTime}}</Filed>
<Filed :span="12" :name="l('deleterUserId')">{{entity.deleterUserId}}</Filed>
<Filed :span="12" :name="l('dictionaryCode')">{{entity.dictionaryCode}}</Filed>
<Filed :span="12" :name="l('codeRuleId')">{{entity.codeRuleId}}</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>
<Modal
v-model="modal"
:title="title"
width="1200"
footer-hide
:mask-closable="false"
>
<component
:is="detail"
:eid="curId"
:treeId="treeId"
@on-close="cancel"
@on-ok="ok"
/>
</Modal>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
import Api from "./api";
export default {
name: "Add",
data() {
return {
modal: false,
title: "新增",
detail: null,
curId: this.eid,
avatorPath: "",
downUrl: fileUrlDown,
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }],
code: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }],
},
fileds: [],
parms: {
app: "material",
eid: null,
name: "",
field: "",
},
props: {
eid: Number
};
},
props: ["eid", "treeId"],
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
this.initFiled();
this.parms.eid = this.$u.guid();
},
methods: {
load(v) {
Api.get({ id: v }).then(r => {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.$emit('on-load')
})
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')
this.$emit("on-close");
},
edit() {
this.curId = this.eid;
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
},
copy() {
this.curId = this.eid;
this.title = "克隆";
this.detail = () => import("./add");
this.modal = true;
},
ok() {
this.modal = false;
this.$emit("on-ok");
},
cancel() {
this.modal = false;
},
l(key) {
key = "document_property_definition" + "." + key;
return this.$t(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;
.row-left {
width: 1000px;
}
ul {
display: -webkit-inline-box;
display: inline-box;
position: absolute;
bottom: 5px;
right: 0px;
li {
width: 70px;
span {
color: #e0e0e0;
}
}
}
</script>
\ No newline at end of file
}
.body-document {
margin-top: 10px;
background: #fff;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
border-radius: 8px;
height: 80vh;
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
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Form ref="form" :model="entity" :rules="rules" :label-width="120">
<Row>
<Col :span="12"><FormItem :label="l('title')" prop="title"> <Input v-model="entity.title"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('field')" prop="field"> <Input v-model="entity.field"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('dataType')" prop="dataType"> <InputNumber v-model="entity.dataType"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('dataLength')" prop="dataLength"> <InputNumber v-model="entity.dataLength"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('dictionaryId')" prop="dictionaryId"> <InputNumber v-model="entity.dictionaryId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('note')" prop="note"> <Input v-model="entity.note"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('unitName')" prop="unitName"> <Input v-model="entity.unitName"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('tag')" prop="tag"> <Input v-model="entity.tag"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('categoryId')" prop="categoryId"> <InputNumber v-model="entity.categoryId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('required')" prop="required"> <InputNumber v-model="entity.required"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('isUnique')" prop="isUnique"> <InputNumber v-model="entity.isUnique"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('fieldType')" prop="fieldType"> <Input v-model="entity.fieldType"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('creationTime')" prop="creationTime"> <DatePicker type="date" v-model="entity.creationTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <InputNumber v-model="entity.creatorUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId"> <InputNumber v-model="entity.lastModifierUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('isDeleted')" prop="isDeleted"> <InputNumber v-model="entity.isDeleted"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('deletionTime')" prop="deletionTime"> <DatePicker type="date" v-model="entity.deletionTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('deleterUserId')" prop="deleterUserId"> <InputNumber v-model="entity.deleterUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('dictionaryCode')" prop="dictionaryCode"> <Input v-model="entity.dictionaryCode"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('codeRuleId')" prop="codeRuleId"> <InputNumber v-model="entity.codeRuleId"></InputNumber>
</FormItem></Col>
<Col span="18">
<Row>
<Col v-for="li in fileds" :key="li.field" :span="li.span">
<FormItem :label="li.title" :prop="li.name">
<Input
v-if="li.dataType == 0"
v-model="entity[li.field]"
:disabled="li.field == 'code'"
></Input>
<InputNumber
v-if="li.dataType == 1 || li.dataType == 2"
v-model="entity[li.field]"
class="w100"
></InputNumber>
<Dictionary
v-if="li.dataType == 3"
v-model="entity[li.field]"
:code="li.note"
></Dictionary>
<Input
v-if="li.dataType == 5"
type="textarea"
v-model="entity[li.filed]"
></Input>
<DatePicker
v-if="li.dataType == 4"
v-model="entity[li.field]"
type="date"
:placeholder="'选择' + li.title"
></DatePicker>
<InputFile
v-if="li.dataType == 6"
v-model="entity[li.field]"
></InputFile>
<!-- <files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" /> -->
<InputFile
v-if="li.dataType == 7"
v-model="entity[li.field]"
></InputFile>
<Input
v-if="li.dataType == 8"
type="textarea"
v-model="entity[li.field]"
></Input>
<state
v-if="li.unitName && (li.dataType == 1 || li.dataType == 2)"
:value="li.unitName"
code="material.main.unitName"
type="tag"
></state>
</FormItem>
</Col>
</Row>
<Row>
<!-- <Col :span="12">
<FormItem :label="l('title')" prop="title">
<Input v-model="entity.title"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('field')" prop="field">
<Input v-model="entity.field"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('dataType')" prop="dataType">
<InputNumber v-model="entity.dataType"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('dataLength')" prop="dataLength">
<InputNumber v-model="entity.dataLength"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('dictionaryId')" prop="dictionaryId">
<InputNumber v-model="entity.dictionaryId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('note')" prop="note">
<Input v-model="entity.note"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('unitName')" prop="unitName">
<Input v-model="entity.unitName"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('tag')" prop="tag">
<Input v-model="entity.tag"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('categoryId')" prop="categoryId">
<InputNumber v-model="entity.categoryId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('required')" prop="required">
<InputNumber v-model="entity.required"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isUnique')" prop="isUnique">
<InputNumber v-model="entity.isUnique"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('fieldType')" prop="fieldType">
<Input v-model="entity.fieldType"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('creationTime')" prop="creationTime">
<DatePicker type="date" v-model="entity.creationTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('creatorUserId')" prop="creatorUserId">
<InputNumber v-model="entity.creatorUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModificationTime')" prop="lastModificationTime">
<DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
<InputNumber v-model="entity.lastModifierUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isDeleted')" prop="isDeleted">
<InputNumber v-model="entity.isDeleted"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('deletionTime')" prop="deletionTime">
<DatePicker type="date" v-model="entity.deletionTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('deleterUserId')" prop="deleterUserId">
<InputNumber v-model="entity.deleterUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('dictionaryCode')" prop="dictionaryCode">
<Input v-model="entity.dictionaryCode"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('codeRuleId')" prop="codeRuleId">
<InputNumber v-model="entity.codeRuleId"></InputNumber>
</FormItem>
</Col>-->
<Col :span="24">
<FormItem :label="l('filePath')" prop="filePath">
<!-- <Input v-model="entity.template" type="textarea" :rows="5"></Input> -->
<files ref="refFile" :parms="parms" files />
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary
code="word.document.status"
v-model="entity.status"
></Dictionary>
</FormItem>
</Col>
<!-- <Col :span="24" style="text-align: right;">
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Col>-->
</Row>
</Col>
<Col span="6">
<FormItem :label="l('img')" prop="img">
<inputFile
class="tphoto"
ref="refmovieFile1"
v-model="imgName"
:parms="parmsName"
/>
</FormItem>
<div class="img-touxiang">
<img :src="avatorPath" v-if="imgName" @click="imgUrl" class="img1" />
<img
src="@/assets/images/files_header.png"
v-else
width="100%"
height="100%"
/>
</div>
</Col>
</Row>
<Row>
<Col :span="24" style="text-align: right">
<FormItem>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Col>
</Row>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Edit',
import Api from "./api";
export default {
name: "Edit",
data() {
return {
disabled: false,
entity: {
},
imgName: "",
avatorPath: "",
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
name: [{ required: true, message: "必填", trigger: "blur" }],
},
fileds: [], //扩展属性
parmsName: "app=material&eid=1&name=document",
parms: {
app: "material",
eid: null,
name: "",
field: "",
},
props: {
eid: Number
};
},
props: ["eid", "treeId"],
mounted() {
if (this.eid > 0) {
this.initFiled();
this.parms.eid = this.$u.guid();
this.$refs.refmovieFile1.inputShow = false;
},
methods: {
imgUrl() {
window.open(this.avatorPath, "_blank");
},
initFiled() {
// let conditions = [
// {
// conditionalType: "Equal",
// fieldName: "categoryId",
// fieldValue: this.eid,
// },
// ];
Api.listbyid({
categoryId: this.treeId,
// sortBy: "id",
// isDesc: false,
}).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 = 12;
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);
}
});
},
methods: {
load(v) {
Api.get({ id: v }).then(r => {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
})
this.avatorPath = fileUrlDown + r.result.img;
this.imgName = r.result.img;
this.entity.status = r.result.status ;
if (r.result.filePath && r.result.filePath != "") {
this.parms.eid = r.result.filePath;
} else {
this.parms.eid = this.$u.guid();
}
this.entity.filePath = this.parms.eid;
});
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
Api.update(this.entity).then((r) => {
this.disabled = false;
if (this.$refs.refFile.nameList.length > 0) {
this.entity.filePath = this.parms.eid;
} else {
this.entity.filePath = "";
}
Api.update(this.entity)
.then((r) => {
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error('保存失败')
this.$Message.error("保存失败");
}
}).catch(err => {
this.disabled = false;
this.$Message.error('保存失败')
console.warn(err)
})
.catch((err) => {
this.$Message.error("保存失败");
console.warn(err);
});
}
})
});
},
handleClose() {
this.$emit('on-close')
this.$emit("on-close");
},
l(key) {
key = "document_property_definition" + "." + key;
return this.$t(key)
}
return this.$t(key);
},
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
},
imgName(newName, oldName) {
const imgPathsArr = JSON.parse(newName);
this.entity.img = imgPathsArr[0].filePath;
this.avatorPath = fileUrlDown + imgPathsArr[0].filePath;
},
},
};
</script>
<style lang="less">
.img-touxiang {
width: 230px;
height: 230px;
margin-left: 58px;
margin-top: -35px;
img {
width: 100%;
height: 100%;
border-radius: 5px;
}
.img1 {
cursor: pointer;
}
}
</script>
\ No newline at end of file
}
</style>
\ No newline at end of file
......@@ -12,7 +12,11 @@
@click="toggle"
title="展开/合并"
></Button>
<Button icon="md-refresh" title="刷新" @click="loadTree()"></Button>
<Button
icon="md-refresh"
title="刷新"
@click="loadTree()"
></Button>
<Button icon="md-rewind" title="收起" @click="hide"></Button>
</ButtonGroup>
</div>
......@@ -22,7 +26,12 @@
</div>
<div class="fg">
<div class="tree">
<Tree :data="data" ref="tree" @on-select-change="change" :render="renderContent"></Tree>
<Tree
:data="data"
ref="tree"
@on-select-change="change"
:render="renderContent"
></Tree>
</div>
</div>
</div>
......@@ -32,8 +41,8 @@
<Icon type="ios-arrow-forward" size="24" />
</a>
</div>
<Content :class="!showMenu?'con_bord':''">
<Word ref="dataTable" :treeId='treeId'/>
<Content :class="!showMenu ? 'con_bord' : ''">
<Word ref="dataTable" :treeId="treeId" :addShow="addShow" :ids="ids" />
</Content>
</Layout>
</div>
......@@ -58,7 +67,9 @@ export default {
model8: "",
keys: "",
expand: false,
treeId:0,
treeId: 0,
addShow: false,
ids: [],
};
},
mounted() {
......@@ -131,13 +142,28 @@ export default {
change(a, b) {
// console.log(a)
console.log(b);
if (b.children.length == 0) {
this.treeId = b.id;
this.$refs.dataTable.$refs.grid.reload(this.easySearch);
} else {
this.treeId = 0;
// if (b.children.length == 0) { //判断最底层才能添加文档
// this.addShow = true;
// this.$refs.dataTable.$refs.grid.reload(this.easySearch);
// } else {
// this.addShow = false;
// }
let ids = [];
ids.push(b.value);
if (b.children) {
addId(b.children);
function addId(data) {
data.map((u) => {
ids.push(u.value);
if (u.children) {
addId(u.children);
}
});
}
}
alert(this.treeId )
// console.log(ids)
this.ids = ids;
},
renderContent(h, { root, node, data }) {
return h(
......
<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
......@@ -9,12 +9,14 @@
:type="typeInfo"
:span="6"
:lazy="true"
exportTitle="文档管理"
>
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input placeholder="请输入关键字引用的文档名称/文档名称" v-model="easySearch.keys.value" />
<Input
placeholder="请输入关键字引用的文档名称/文档名称"
v-model="easySearch.keys.value"
/>
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
......@@ -26,47 +28,79 @@
</template>
<template slot="buttons">
<Button type="primary" @click="add">新增</Button>
<Button :icon="iconInfo" shape="circle" :title="titleInfo" @click="changeShwo"></Button>
<Button @click="openModalIm">导入</Button>
<Button
:icon="iconInfo"
shape="circle"
:title="titleInfo"
@click="changeShwo"
></Button>
</template>
<template slot="card" slot-scope="{row}">
<template slot="card" slot-scope="{ row }">
<div class="body-card">
<Row class="title-i">
<Col :span="12">
<Ellipsis :text="row.name" :length="12" tooltip />
</Col>
<Col :span="12" class="btn-click">{{row.code}}</Col>
<Col :span="12" class="btn-click">{{ row.code }}</Col>
</Row>
<Row class="row-down" :gutter="10">
<Col span="7">
<div class="img-i">
<img :src="downUrl+'/' +row.filePath" v-if="row.filePath" />
<img :src="downUrl + row.img" v-if="row.img" />
<!-- onerror="this.src='/imgicon/chan_Pin.png'" -->
<img src="@/assets/imgicon/chan_Pin.png" v-else width="100%" height="100%" />
<img
src="@/assets/imgicon/chan_Pin.png"
v-else
width="100%"
height="100%"
/>
</div>
</Col>
<Col span="17" class="c">
<div>版本:{{row.version}}</div>
<div>文档详细说明:{{row.description}}</div>
<Col span="17">
<div class="c">
<div>版本:{{ row.version }}</div>
<div>
状态:
<state code="word.document.status" :value="row.status" />
</div>
<!-- <div>
创建人:
<User :value="row.creatorUserId" />
</div>-->
<div class="shuo-ming">
<span>文档说明:</span>
<Ellipsis :text="row.description" :length="12" tooltip />
</div>
</div>
<p class="a-icon">
<a @click="edit(row)">
<Icon type="md-create" />编辑
</a>&nbsp;
<a @click="remove(row)">
<Icon type="ios-trash" />删除
</a>&nbsp;
<a @click="view(row)">
<Icon type="md-document" />详情
</a>
</p>
<div class="a-icon">
<a @click="edit(row.id)"> <Icon type="md-create" />编辑 </a
>&nbsp;
<a @click="remove(row.id)"> <Icon type="ios-trash" />删除 </a
>&nbsp;
<a @click="view(row.id)"> <Icon type="md-document" />详情 </a>
</div>
</Col>
</Row>
</div>
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" :treeId="treeId" @on-close="cancel" @on-ok="ok" />
<Modal
v-model="modal"
:title="title"
width="1200"
footer-hide
:mask-closable="false"
:fullscreen="fullscreen"
>
<component
:is="detail"
:eid="curId"
:treeId="treeId"
@on-close="cancel"
@on-ok="ok"
/>
</Modal>
</div>
</template>
......@@ -76,11 +110,12 @@ export default {
data() {
return {
action: Api.index,
fullscreen: false,
easySearch: {
keys: { op: "refName,name", value: null },
categoryId: {
op: "In",
value: this.treeId,
value: this.ids,
},
},
modal: false,
......@@ -96,68 +131,34 @@ export default {
align: "left",
high: true,
},
{ key: "name", title: this.l("title"), align: "left", high: true },
{
key: "title",
title: this.l("title"),
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"),
key: "creationTime",
title: this.l("creationTime"),
align: "left",
easy: true,
high: true,
},
{ key: "tag", title: this.l("tag"), align: "left", high: true },
{
key: "categoryId",
title: this.l("categoryId"),
key: "code",
title: this.l("name"),
align: "left",
high: true,
},
{
key: "required",
title: this.l("required"),
key: "status",
title: this.l("status"),
align: "left",
high: true,
render: (h, params) => {
return h("div", [
h("span", params.row.status == 0 ? "草稿" : "送审"),
]);
},
{
key: "isUnique",
title: this.l("isUnique"),
align: "left",
high: true,
},
{
key: "fieldType",
title: this.l("fieldType"),
align: "left",
high: true,
},
{
key: "creationTime",
title: this.l("creationTime"),
key: "version",
title: this.l("revision"),
align: "left",
high: true,
},
......@@ -166,49 +167,7 @@ export default {
title: this.l("creatorUserId"),
align: "left",
high: true,
},
{
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,
type: "user",
},
{
title: "操作",
......@@ -255,6 +214,8 @@ export default {
},
props: {
treeId: Number,
addShow: Boolean,
ids: Array,
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
......@@ -273,15 +234,6 @@ export default {
this.titleInfo = "卡片模式";
}
},
//批量导入start
//导入功能
openModalIm() {
if (this.parent.id) {
this.ModalIm = true;
} else {
this.$Message.error("请先选择文档分类");
}
},
ok() {
this.$refs.grid.reload(this.easySearch);
this.modal = false;
......@@ -291,29 +243,36 @@ export default {
this.$refs.grid.reload(this.easySearch);
},
add() {
if (this.treeId == 0) {
this.$Message.error("请在分类下添加文档");
} else {
// if (this.addShow == false) { //判断最底层才能添加文档
// this.$Message.error("请在分类最子集新增文档");
// } else {
this.fullscreen = false;
this.curId = 0;
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
// }
}
},
copy(id) {
this.curId = id;
this.title = "克隆";
this.detail = () => import("./add");
this.modal = true;
},
view(id) {
this.fullscreen = true;
this.curId = id;
this.title = "详情";
this.detail = () => import("./detail");
this.modal = true;
},
edit(id) {
this.fullscreen = false;
this.curId = id;
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
},
remove(id) {
Api.delete(id).then((r) => {
if (r.success) {
......@@ -347,11 +306,23 @@ export default {
},
},
watch: {
treeId(v) {
if (v != 0) {
this.easySearch.categoryId.value = v;
// treeId(v) {
// alert(v)
// if (v != 0) {
// // this.easySearch.categoryId.value = v;
// this.$refs.grid.reload(this.easySearch);
// }
// },
ids: {
handler(newName, oldName) {
// console.log("ovo", newName, oldName);
// console.log(newName);
this.easySearch.categoryId.value = newName;
this.$refs.grid.reload(this.easySearch);
}
},
// immediate: true,
deep: true,
},
},
};
......@@ -360,7 +331,7 @@ export default {
.product-m {
.body-card {
border: 1px solid rgba(38, 128, 235, 1);
margin: 10px;
margin: 5px 0;
border-radius: 4px;
.title-i {
......@@ -375,28 +346,27 @@ export default {
text-align: right;
}
}
.row-down {
padding: 10px;
height: 110px;
.img-i {
width: 90px;
background: #eee;
height: 90px;
margin-right: 15px;
// overflow: hidden;
img {
width: 90px;
height: 90px;
}
}
.c div {
margin-bottom: 14px;
margin-left: 10px;
.c {
padding-left: 8px;
div {
height: 18px;
}
}
.shuo-ming {
display: -webkit-inline-box;
}
.a-icon {
text-align: right;
}
......
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