first commit

This commit is contained in:
2026-09-08 19:49:21 +08:00
commit ebffbab428
7320 changed files with 1477614 additions and 0 deletions
@@ -0,0 +1,362 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.v-tree-layout-left {
overflow: unset !important;
}
.v-tree-layout-left .v-tree {
width: 100%;
height: calc(100vh - 170px);
overflow-y: auto;
}
.v-tree:hover::-webkit-scrollbar {
width: 3px;
background-color: transparent;
}
.v-tree-layout-left .custom-tree-node {
width: 90%;
position: relative;
display: flex;
align-items: center;
}
.v-tree-layout-left .v-tree .v-node {
width: 100%;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
::-webkit-scrollbar {
/*width: 3px;*/
/*background-color: transparent;*/
display: none;
}
::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.2);
border-radius: 10px;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never" style="height: calc(100vh - 70px)">
<tree-layout>
<template #tree>
<div style="padding:0 20px 20px;">
<el-input placeholder="输入关键字进行查找" v-model="filterText"></el-input>
</div>
<el-tree ref="tree" :data="treeData" class="v-tree" v-loading="treeLoading" node-key="id"
:props="defaultProps"
:default-expanded-keys="['7e3f5fcbc24f442dbb3a6cc9412e7960']" :expand-on-click-node="false"
@node-click="handleNodeClick" accordion
highlight-current :filter-node-method="filterNode">
<div class="custom-tree-node" slot-scope="{ node, data }">
<div v-if="node.level==1" style="font-size: 16px;" class="v-node"><i
class="el-icon-s-home"></i>&nbsp;
{{ data.name }}
</div>
<div v-if="node.level==2"
style="font-size: 15px" :title="data.name" class="v-node">
<i class="el-icon-star-on" v-if="checkData.name==data.name"></i>
<i class="el-icon-star-off" v-else></i>
&nbsp; {{ data.name }}
</div>
<div v-if="node.level==3"
style="font-size: 14px" :title="data.name" class="v-node">
<i class="fa fa-dot-circle-o" v-if="checkData.name==data.name"></i>
<i class="fa fa-circle-o" v-else></i>
&nbsp; {{ data.name }}
</div>
<div v-if="node.level>3"
style="font-size: 14px" :title="data.name" class="v-node">
<i class="fa fa-dot-circle-o" v-if="checkData.name==data.name"></i>
<i class="fa fa-circle-o" v-else></i>
&nbsp; {{ data.name }}
</div>
</div>
</el-tree>
</template>
<template v-if="node.level==1">
<div v-if="node.level==1" style="padding:0 10px">
<el-card shadow="never">
<div class="text-right">
<el-button size="medium" type="primary" @click="openBasicType()">
<i class="el-icon-plus"></i>
新建基础类型
</el-button>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<el-table :data="basicTypeData" height="656px">
<el-table-column label="序号" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column prop="name" align="center" label="名称"></el-table-column>
<el-table-column prop="code" align="center" label="代码"></el-table-column>
<el-table-column prop="note" align="center" show-overflow-tooltip
label="备注"></el-table-column>
<el-table-column align="center" label="操作" width="100px">
<template scope="{row}">
<el-dropdown @command="dropdownCommand">
<el-button plain size="mini">
<i class="ti-settings"></i>
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{type:'edit',data:row}"
:disabled="checkData.code==50000||checkData.code==40000">
编辑
</el-dropdown-item>
<el-dropdown-item :command="{type:'delete',data:row}"
:disabled="checkData.code==50000||checkData.code==40000||checkData.code=='jcsjgl'">
删除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="(val)=>{pageForm.pageSize = val;pageData()}"
@current-change="(val)=>{pageForm.pageNumber = val;pageData()}"
:current-page="pageForm.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next"
:total="pageForm.totalCount">
</el-pagination>
</el-card>
</div>
</template>
</tree-layout>
</el-card>
</guava>
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="basicTypeDialog" width="50%">
<el-form :model="formData" ref="addForm" :rules="rules" label-width="100px">
<el-row gutter="30">
<el-form-item label="上级名称" prop="name" label-width="110px">
<el-input maxlength="100" disabled :value="checkData.name"
type="text"></el-input>
</el-form-item>
<el-form-item label="基础类型名称" prop="name" label-width="110px">
<el-input maxlength="100" placeholder="请输入基础类型名称" v-model="formData.name"
type="text"></el-input>
</el-form-item>
<el-form-item label="基础类型代码" prop="code" label-width="110px">
<el-input maxlength="100" placeholder="请输入基础类型名称" v-model="formData.code"
type="text"
:disabled="checkData.code==50000||checkData.code==40000||checkData.code=='jcsjgl'"></el-input>
</el-form-item>
<el-form-item label="基础类型备注" prop="note" label-width="110px">
<el-input maxlength="100" placeholder="请输入基础类型备注" v-model="formData.note"
type="textarea"></el-input>
</el-form-item>
</el-row>
</el-form>
<div style="display: flex;justify-content:flex-end;margin-top: 30px">
<el-button type="primary" :loading="loading" @click="!formData.id?doAddType():doEditType()">提 交
</el-button>
</div>
</el-dialog>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
title: '',
checkData: {},
filterText: '',
treeData: [],
basicTypeData: [],
tableData: [],
treeLoading: true,
basicTypeDialog: false,
loading: false,
defaultProps: {
children: 'child',
label: 'name',
},
node: {
level: 1
},
options: [{
value: 'ziyuan',
label: '资源',
children: [{
value: 'axure',
label: 'Axure Components'
}]
}],
rules: {
name: [{required: true, message: '必填', trigger: ['change', 'blur']}],
code: [{required: true, message: '必填', trigger: ['change', 'blur']}],
},
}
},
components: {
'tree-layout': httpVueLoader('/components/plugins/TreeLayout.vue'),
'guava': httpVueLoader('/components/plugins/Guava.vue'),
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
},
},
methods: {
dropdownCommand: function (command) {
const {type, data} = command
if (type == 'edit') {
this.openEditType(data)
} else if (type == 'delete') {
this.doDelete(data.id)
}
},
pageData() {//加载机构数据
sublime.showLoadingbar();//显示loading
this.tabLoading = true
this.pageForm.parentId = this.checkData.id
$.post(loc() + "/pageData", this.pageForm, (data) => {
sublime.closeLoadingbar();//关闭loading
this.tabLoading = false
if (data.code == 0) {
this.basicTypeData = data.data.list;
this.pageForm.totalCount = data.data.totalCount;
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
}, "json");
},
filterNode(value, data, node) {
if (!value) return true;
return data.name.indexOf(value) !== -1
return false
},
async handleNodeClick(data, node) {
this.checkData = data
this.checkNode = node
console.log(this.checkData)
this.pageData()
},
async loadTree(flush) {
this.treeLoading = true
const resp = await $.post(loc() + "/getTreeData")
this.treeLoading = false
if(resp.code===0){
this.treeLoading = false
this.treeData = resp.data
}else{
this.notifyWarning(resp.msg)
}
if (flush && resp.code === 0) {
this.checkData = resp.data[0]
this.pageData();
}
},
async openBasicType() {
const {id} = this.checkData
this.formData = {
parentId: id
}
this.basicTypeDialog = true
if (this.$refs['addForm']) {
this.$refs['addForm'].resetFields()
}
},
doAddType() {
this.$refs["addForm"].validate(async (valid) => {
if (valid) {
this.loading = true
const resp = await $.post(loc() + "/doAdd", this.formData)
this.loading = false
if(resp.code===0){
this.basicTypeDialog = false
this.pageData();
this.loadTree(true)
}else{
this.notifyWarning(resp.msg)
}
}
})
},
doEditType() {
this.$refs["addForm"].validate(async (valid) => {
if (valid) {
this.loading = true
const resp = await $.post(loc() + "/doEditType", this.formData)
this.loading = false
this.basicTypeDialog = false
if(resp.code===0){
this.pageData();
}else{
this.notifyWarning(resp.msg)
}
}
});
},
openEditType(row) {
this.formData = {
id: row.id,
name: row.name,
code: row.code,
note: row.note
}
this.basicTypeDialog = true
},
doDelete(id) {
this.$confirm('确定要删除该机构吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(loc() + "/doDelete", {id: id})
if(resp.code===0){
this.notifySuccess(resp.msg)
this.pageData()
this.loadTree(true)
}else{
this.notifyWarning(resp.msg)
}
}
}
});
}
},
async created() {
this.loadTree(true)
}
})
</script>
<!--#
}
#-->