master
xy 3 years ago
parent 1e7b8951ac
commit df6df947f2

@ -12,7 +12,7 @@
<template>
<div class="dropdown-box">
<div class="left">
<div class="left-item" v-for="i in ['制度文件','工作流程','岗位工作及标准','表单中心']" @click="selectValue = i">
<div class="left-item" v-for="i in ['制度文件','工作流程','岗位工作及标准','表单中心','部门工作职责']" @click="selectValue = i">
{{ i }}
</div>
</div>
@ -27,8 +27,8 @@
</el-button>
<template #dropdown>
<el-dropdown-menu class="select-drop">
<el-dropdown-item command="制度文件">
<div style="text-align: center">制度文件</div>
<el-dropdown-item command="规章制度">
<div style="text-align: center">规章制度</div>
</el-dropdown-item>
<el-dropdown-item command="工作流程">
<div style="text-align: center">工作流程</div>
@ -39,6 +39,9 @@
<el-dropdown-item command="表单中心">
<div style="text-align: center">表单中心</div>
</el-dropdown-item>
<el-dropdown-item command="部门工作职责">
<div style="text-align: center">部门工作职责</div>
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
@ -121,6 +124,9 @@ export default {
flex: 1;
background: url("../../assets/reception/search-bottom-bkg.png") no-repeat center;
background-size: cover;
display: flex;
flex-direction: column;
justify-content: space-between;
& .search-bar {
display: flex;
@ -154,7 +160,7 @@ export default {
display: flex;
align-items: center;
margin: 43px 0 0 8.8%;
margin: 0 0 43px 8.8%;
&__word {
font-size: 13px;
@ -166,7 +172,7 @@ export default {
}
}
.search {
height: 295px;
height: 342px;
width: 100%;
padding: 33px 18.75% 38px 18.75%;

@ -17,6 +17,10 @@ router.beforeEach(async(to, from, next) => {
// set page title
document.title = getPageTitle(to.meta.title)
if (/^\/index\/.*/.test(to.path)) {
next()
return
}
// determine whether the user has logged in
const hasToken = getToken()

@ -0,0 +1,79 @@
<script>
export default {
props: {
info: Object,
detail: Object,
},
data() {
return {};
},
methods: {},
computed: {},
render(h) {
let { edit_input, select_item, _relations, field } = this.info;
if (edit_input === "richtext") {
return (
<el-scrollbar>
<div
style={{ "max-height": "50px" }}
domPropsInnerHTML={this.detail[field]}
></div>
</el-scrollbar>
);
}
if (
select_item &&
typeof select_item === "object" &&
!(select_item instanceof Array)
) {
let keys = Object.keys(select_item);
let paramMap = new Map();
keys.forEach((key) => {
paramMap.set(select_item[key], key);
});
return <span>{paramMap.get(this.detail[field]?.toString())}</span>;
}
if (_relations) {
let { link_relation, foreign_key, link_with_name } = _relations;
if (link_relation === "newHasOne" || link_relation === "hasOne") {
if (edit_input === "file") {
return (
<a
download={this.detail[link_with_name]?.original_name}
href={this.detail[link_with_name]?.url}
>
{this.detail[link_with_name]?.original_name}
</a>
);
} else {
return (
<span>
{this.detail[link_with_name]?.name ||
this.detail[link_with_name]?.no ||
this.detail[link_with_name]?.value}
</span>
);
}
}
if (link_relation === "hasMany" || link_relation === "newHasMany") {
return (
<div>
{this.detail[link_with_name]?.map((o) => (
<span>{o?.name || o?.no || o?.value}</span>
))}
</div>
);
}
}
return (
<span>{this.detail[field]}</span>
);
},
};
</script>
<style scoped lang="scss"></style>

@ -3,6 +3,7 @@ import { save, show, index } from "@/api/system/baseForm";
import { getparameter } from "@/api/system/dictionary";
import { domMap } from "@/const/inputType";
import { addPropsMap } from "@/const/addProps";
import {deepCopy} from "@/utils";
export default {
props: {
formInfo: {
@ -16,9 +17,10 @@ export default {
"el-dialog",
{
props: {
top: '8vh',
title: "新增",
visible: this.dialogVisible,
width: "600px",
width: "700px",
},
on: {
"update:visible": (val) => {
@ -27,16 +29,23 @@ export default {
},
},
[
h(
h('el-scrollbar', {
style: {
'height': '58vh'
}
}, [h(
"el-form",
{
ref: "elForm",
style: {
'padding-right': '12px'
},
props: {
model: this.form,
labelWidth: "80px",
rules: this.rules,
labelPosition: "right",
size: "small",
size: "small"
},
},
(() => {
@ -149,7 +158,7 @@ export default {
});
return dom;
})()
),
)]),
h("template", { slot: "footer" }, [
h(
"el-button",
@ -360,6 +369,8 @@ export default {
},
submit() {
console.log(this.form)
return
if (this.type === "add") {
if (this.form.hasOwnProperty("id")) {
delete this.form.id;
@ -369,6 +380,10 @@ export default {
if (/^\/manage/.test(this.$route.path)) {
this.form['zhuangtai'] = 0
}
if (this.tableName === 'materials') {
this.form['leixing'] = Number(this.$route.meta.params.type);
}
}
if (this.type === "editor") {
Object.defineProperty(this.form, "id", {
@ -380,34 +395,39 @@ export default {
}
this.$refs["elForm"].validate((validate) => {
if (validate) {
let copyForm = deepCopy(this.form)
this.formInfo.forEach((info) => {
if (info._relations?.link_with_name) {
if (info.edit_input === "files" || info.edit_input === "file") {
this.form[info._relations.link_with_name] = this.file[info.field].map(i => {
return {
[info._relations.foreign_key]: i?.response?.id
}
});
delete this.form[info.field]
if (info._relations?.link_relation === 'newHasMany' || info._relations?.link_relation === 'hasMany') {
if (info.edit_input === 'files') {
copyForm[info._relations.link_with_name] = this.file[info.field].map(i => i?.response);
} else {
this.form[info._relations.link_with_name] = this.form[info.field] instanceof Array ? this.form[info.field].map(i => {
return {
[info._relations.foreign_key]: i
}
}) : [{ [info._relations.foreign_key]: this.form[info.field] }]
delete this.form[info.field]
copyForm[info._relations.link_with_name] = copyForm[info.field]
}
delete copyForm[info.field]
}
// if (info.edit_input === "files") {
// this.form[info.field] = this.file[info.field].map(
// (i) => i?.response?.id
// );
// }
// if (info.edit_input === "file") {
// this.form[info.field] = this.file[info.field][0]?.response?.id;
if (info._relations?.link_relation === 'newHasOne' || info._relations?.link_relation === 'hasOne') {
if (info.edit_input === 'file') {
//this.form[info._relations.link_with_name] =
} else {
}
delete copyForm[info.field]
}
// if (info._relations?.link_with_name) {
// if (info.edit_input === "files" || info.edit_input === "file") {
// this.form[info._relations.link_with_name] = this.file[info.field].map(i => i?.response);
// delete this.form[info.field]
// } else {
// this.form[info._relations.link_with_name] = this.form[info.field] instanceof Array ? this.form[info.field].map(i => {
// return info._params.find(param => i === param[info._relations.foreign_key])
// }) : [info._params.find(param => this.form[info.field] === param[info._relations.foreign_key])]
// delete this.form[info.field]
// }
// }
});
save(Object.assign(this.form, { table_name: this.tableName })).then(
save(Object.assign(copyForm, { table_name: this.tableName })).then(
(res) => {
this.$Message.success({
content: `${this.type === "add" ? "新增" : "编辑"}成功`,
@ -448,13 +468,6 @@ export default {
if (i.edit_input === "checkbox") {
this.form[i.field] = [];
}
//TODO:
if (this.tableName === 'materials') {
if (i.field === 'leixing') {
this.form[i.field] = Number(this.$route.meta.params.type);
}
}
}
});
},
@ -466,7 +479,6 @@ export default {
this.$nextTick(() => this.getDetail());
}
} else {
this.file = {};
this.id = "";
this.type = "";
this.init();
@ -489,4 +501,5 @@ export default {
color: red;
text-decoration: underline;
}
</style>

@ -4,7 +4,7 @@
ref="elDrawer"
:title="detail.name || '详情'"
:visible.sync="isShow"
size="45%"
size="80%"
direction="rtl"
>
<template>
@ -18,9 +18,9 @@
style="margin: 20px 10px"
>
<template v-for="info in formInfo">
<el-descriptions-item :label="info.name">{{
contentFormat(info)
}}</el-descriptions-item>
<el-descriptions-item :label="info.name">
<descriptionItem :info="info" :detail="detail"></descriptionItem>
</el-descriptions-item>
</template>
</el-descriptions>
</template>
@ -30,7 +30,12 @@
<script>
import { show } from "@/api/system/baseForm";
import descriptionItem from "@/views/component/descriptionItem.vue";
export default {
components: {
descriptionItem
},
props: {
formInfo: {
type: Array,
@ -99,7 +104,6 @@ export default {
},
true
).then((res) => {
console.log(111, res);
this.detail = res;
});
}

@ -238,6 +238,7 @@
</div>
<xy-table
:btn-width="200"
:auths="auths_auth_mixin"
:delay-req="true"
:destroy-action="destroy"
@ -270,7 +271,7 @@
@refresh="$refs['xyTable'].getTableData()"
>
<template #fujian="{ fieldInfo, form, file }" v-if="$route.meta.params && $route.meta.params.type == 1">
<flow :field-info="fieldInfo" :form="form" :file="file"></flow>
<flow :field-info="fieldInfo" :form="form" :file="file" @update="val => form['fujian'] = val"></flow>
</template>
</dialoger>
<drawer
@ -327,9 +328,9 @@ export default {
table_name: "",
filter: [
{
key: "leixing",
op: "eq",
value: this.$route.meta.params?.type,
key: this.$route.meta.params?.type ? "leixing" : '',
op: this.$route.meta.params?.type ? "eq" : '',
value: this.$route.meta.params?.type || '',
},
{
key: "",
@ -475,7 +476,17 @@ export default {
.map((i) => {
let linkOb = {};
if (i.select_item && typeof i.select_item === 'object') {
if (i.edit_input === 'richtext') {
linkOb.customFn = row => {
return (
<el-scrollbar>
<div style={{ 'max-height': '50px' }} domPropsInnerHTML={row[i.field]}></div>
</el-scrollbar>
)
}
}
if (i.select_item && typeof i.select_item === 'object' && !(i.select_item instanceof Array)) {
let keys = Object.keys(i.select_item)
linkOb.customFn = row => {
let paramMap = new Map()
@ -485,7 +496,7 @@ export default {
return (
<span>
{ paramMap.get(row[i.field].toString()) }
{ paramMap.get(row[i.field]?.toString()) }
</span>
)
}
@ -542,6 +553,8 @@ export default {
width: 60,
label: "序号",
});
console.log(111,this.form)
},
},
@ -612,4 +625,5 @@ a:hover {
color: red;
text-decoration: underline;
}
</style>

@ -15,7 +15,7 @@
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
<formList ref="formList"></formList>
<formList ref="formList" :value="selections" @selected="selectedHandler"></formList>
</div>
</template>
@ -33,14 +33,29 @@ export default {
data() {
return {
action: process.env.VUE_APP_UPLOAD_API,
selections: [],
}
},
methods: {
selectedHandler (ids) {
this.selections = Array.from(new Set(ids))
this.$emit('update', this.selections)
}
},
methods: {},
computed: {
fileList () {
return (this.file && this.fieldInfo?.field) ? this.file[this.fieldInfo.field] : []
}
},
},
watch: {
form: {
handler(newVal) {
this.selections = newVal[this.fieldInfo.field]
},
immediate: true
}
}
}
</script>

@ -4,9 +4,21 @@
:append-to-body="true"
title="表单中心"
:visible.sync="dialogVisible"
width="30%">
width="60%">
<template>
<Table></Table>
<Table :row-key="true" :loading="isLoading" :columns="table" :data="data" size="small" @on-selection-change="selectionChange"></Table>
<div style="display: flex;justify-content: center;margin-top: 10px;">
<el-pagination
small
layout="prev, pager, next"
:total="total"
@current-change="e => {
select.page = e
getData()
}">
</el-pagination>
</div>
</template>
<template #footer>
<el-button @click="dialogVisible = false"> </el-button>
@ -19,12 +31,61 @@
<script>
import { index } from "@/api/system/baseForm"
export default {
props: {
value: Array
},
data() {
return {
dialogVisible: false,
isLoading: false,
total: 0,
data: [],
table: [],
table: [
{
width: 54,
type: 'selection'
},
{
key: 'nianfen',
title: '年份',
width: 100
},
{
key: 'wenjian',
title: '文件',
width: 120
},
{
key: 'bianhao',
title: '编号',
width: 120
},
{
key: 'biaoti',
title: '标题',
width: 140
},
{
key: 'beizhu',
title: '备注',
align: 'left',
minWidth: 200
},
{
key: 'admin',
title: '创建人',
width: 140,
render: (h, { row }) => {
return h('span', row.admin?.name)
}
},
{
key: 'created_at',
title: '创建日期',
width: 160
}
],
select: {
page: 1,
page_size: 10,
@ -48,8 +109,22 @@ export default {
},
async getData() {
this.isLoading = true
const res = await index(this.select)
console.log(111,res)
console.log(222,this.value)
this.data = res.data.map(i => {
return {
_checked: this.value?.indexOf(i.id) !== -1,
...i
}
})
this.total = res.total
this.isLoading = false
},
selectionChange(selection) {
this.$emit('selected', selection.map(i => i.id))
}
},
computed: {},

Loading…
Cancel
Save