Commit 27a9ff96 authored by 张俊's avatar 张俊
parents c5ac0b79 804b6957
......@@ -41,19 +41,19 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行
- export NODE_ENV=production
- yarn build
# - name: s3-cache-build
# image: registry.cn-qingdao.aliyuncs.com/wod/devops-s3-cache:1.0
# network_mode: host
# settings:
# rebuild: true
# hash: package.json
# mount:
# - node_modules
# endpoint: http://cache.wodcloud.com
# access_key:
# from_secret: ACCESS_KEY_MINIO
# secret_key:
# from_secret: SECRET_KEY_MINIO
- name: s3-cache-build
image: registry.cn-qingdao.aliyuncs.com/wod/devops-s3-cache:1.0
network_mode: host
settings:
rebuild: true
hash: package.json
mount:
- node_modules
endpoint: http://cache.wodcloud.com
access_key:
from_secret: ACCESS_KEY_MINIO
secret_key:
from_secret: SECRET_KEY_MINIO
- name: docker
image: registry.cn-qingdao.aliyuncs.com/wod/devops-docker:1.0
......@@ -65,7 +65,7 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行
base: registry.cn-qingdao.aliyuncs.com/wod/nginx:1.19.5 # 基础镜像,根据项目需求进行使用,如果第三方登录改成ui-base
dockerfile: .beagle/dockerfile
repo: wod/apaas-system-ui # 生成镜像的 分组/名称
version: "5.0.1" # 版本号
version: "5.0.3" # 版本号
channel: alpha # 后缀 example: alpha test fix-alpha fix等
args: "TARGETOS=linux,TARGETARCH=amd64" # 不同架构的构建参数
registry: registry.cn-qingdao.aliyuncs.com # 私有仓库地址
......@@ -80,7 +80,7 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行
namespace: apaas-v5
deployment: apaas-manage-ui
container: apaas-manage-ui
image: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.1-alpha
image: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.3-alpha
environment:
KUBERNETES_SERVER:
from_secret: KUBERNETES_SERVER
......@@ -96,7 +96,7 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行
base: registry.cn-qingdao.aliyuncs.com/wod/nginx:1.19.5-arm64
dockerfile: .beagle/dockerfile
repo: wod/apaas-system-ui
version: "5.0.1"
version: "5.0.3"
channel: alpha-arm64
args: "TARGETOS=linux,TARGETARCH=arm64"
registry: registry.cn-qingdao.aliyuncs.com
......@@ -134,8 +134,8 @@ steps:
REGISTRY_PASSWORD:
from_secret: REGISTRY_PASSWORD_ALIYUN
settings:
source: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.1-alpha
target: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.1
source: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.3-alpha
target: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.3
registry: registry.cn-qingdao.aliyuncs.com
- name: harbor-arm64
......@@ -152,8 +152,8 @@ steps:
REGISTRY_PASSWORD:
from_secret: REGISTRY_PASSWORD_ALIYUN
settings:
source: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.1-alpha-arm64
target: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.1-arm64
source: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.3-alpha-arm64
target: registry.cn-qingdao.aliyuncs.com/wod/apaas-system-ui:5.0.3-arm64
registry: registry.cn-qingdao.aliyuncs.com
##--------------对于需要保密的信息隐藏,减少账户信息的泄密⬇-----------------##
---
......
......@@ -31,7 +31,10 @@
:class="{current:isCurrent(item.children&&item.children.length?[...getChildrenPath(item.children),item.path]:[item.path])}"
@click="$router.push(item.path)"
>
<span :style="{ paddingLeft: `${deep*2}em` }">{{ item.menuName }}</span>
<span :style="{ paddingLeft: item.icon ? `${deep*2 - 1.37}em` :`${deep*2}em` }">
<bg-icon v-if="item.icon" style="color:#7c8292;" :icon="'#'+item.icon"></bg-icon>
{{ item.menuName }}
</span>
</div>
</template>
</li>
......
......@@ -44,6 +44,10 @@
</div>
</template>
</el-upload>
<el-dialog title="图片预览" v-model="dialogVisible" custom-class="bg-upload-image-dialog">
<img style="margin:30px 0;width: 600px;" :src="dialogImageUrl" alt="Preview Image" />
</el-dialog>
</template>
<script>
......@@ -59,7 +63,7 @@ export default {
},
action: {
type: String,
default: "/apaas/common/file/upload",
default: "/apaas/common/image/upload",
},
autoUpload: {
type: Boolean,
......@@ -74,7 +78,7 @@ export default {
},
multiple: {
type: Boolean,
default: true,
default: false,
},
accept: {
......@@ -100,7 +104,7 @@ export default {
default: "",
},// 自定义提示内容
},
emits: ['update:modelValue'],
emits: ['update:modelValue',"change"],
computed: {
acceptTypes() {
if (Array.isArray(this.accept)) {
......@@ -142,6 +146,8 @@ export default {
return {
fileList: [],
UploadFilled,
dialogImageUrl:'',
dialogVisible:false
};
},
watch: {
......@@ -154,9 +160,22 @@ export default {
if (newStr !== oldStr) {
this.fileList = [...this.modelValue];
}
this.$nextTick().then(() => {
this.checkLimit(this.modelValue)
});
},
},
methods: {
checkLimit(filelist) {
const limit = this.limit
const uploadDom = this.$refs['upload']
const length = uploadDom.$el.children[0].children.length
if (filelist.length === limit) {
uploadDom.$el.children[0].children[length-1].style.display = 'none'
} else {
uploadDom.$el.children[0].children[length-1]?uploadDom.$el.children[0].children[length-1].style.display = '':''
}
},
handleBeforeUpload(file) {
let units = {
KB: 1024,
......@@ -181,17 +200,21 @@ export default {
},
handleSuccess(response, file, fileList) {
this.updateFileList(fileList);
this.checkLimit(fileList)
},
handleRemove(file, fileList) {
this.updateFileList(fileList);
this.checkLimit(fileList)
},
handlePreview({ name, url }) {
let a = document.createElement("a"); // 生成一个a元素
let event = new MouseEvent("click"); // 创建一个单击事件
this.dialogImageUrl = url
this.dialogVisible = true
// let a = document.createElement("a"); // 生成一个a元素
// let event = new MouseEvent("click"); // 创建一个单击事件
a.download = name; // 设置图片名称
a.href = url; // 将生成的URL设置为a.href属性
a.dispatchEvent(event); // 触发a的单击事件
// a.download = name; // 设置图片名称
// a.href = url; // 将生成的URL设置为a.href属性
// a.dispatchEvent(event); // 触发a的单击事件
},
updateFileList(fileList) {
let values = fileList.map((v) => {
......@@ -206,6 +229,7 @@ export default {
console.log(values);
this.$emit("update:modelValue", values);
this.$emit("change",values);
},
submitUpload() {
this.$refs.upload.submit();
......
......@@ -19,6 +19,7 @@
:disabled="actionDisabled"
style="max-width: 600px"
multiple
drag
>
<!-- <el-button type="primary">
上传附件
......@@ -175,6 +176,10 @@ export default {
},
handleExceed(file, fileList) {
console.log(file, fileList);
if (fileList && fileList.length == this.limit) {
this.$message.error(`最多只允许上传${this.limit}个文件`)
return false
}
},
handlePreview(val) {
let a = document.createElement("a"); // 生成一个a元素
......@@ -209,3 +214,9 @@ export default {
},
};
</script>
<style>
.bg-upload .el-upload-dragger{
padding: 0;
border: 0;
}
</style>
......@@ -2559,6 +2559,7 @@ a {
width: 100%;
.el-checkbox {
width: 100%;
.el-checkbox__label {
overflow: hidden;
text-overflow: ellipsis;
......@@ -2620,7 +2621,7 @@ a {
}
.bg-permission-option--self {
width: 168px;
width: 128px;
&.full-option {
width: 100%;
......@@ -2628,7 +2629,7 @@ a {
}
.bg-permission-option--list {
width: calc(100% - 168px);
width: calc(100% - 128px);
&.flex-wrap {
display: flex;
......@@ -2640,10 +2641,13 @@ a {
>.bg-permission-option {
>.bg-permission-option--self {
width: 168px;
width: 128px;
border-right: none;
border-bottom: none;
}
}
}
}
.bg-upload-image-dialog {
width: 650px;
}
\ No newline at end of file
......@@ -103,6 +103,16 @@
<el-form-item label="名称" prop="name">
<el-input
v-model="formData.name"
show-word-limit
:maxlength="
nodeClassifyId == 'eb9c7d70-c123-42b7-8e61-dde1b022b669'
? 6
: nodeClassifyId == 'efd9ec3b-7f18-49e2-9d88-bcca022243bb'
? 4
: nodeClassifyId == '949a1138-4995-464e-97a9-424d097eb271'
? 2
: 20
"
placeholder="请输入名称"
></el-input>
</el-form-item>
......@@ -232,8 +242,7 @@ const state = reactive({
},
rules: {
name: [
{ required: true, message: "请输入名称", trigger: "blur" },
{ max: 20, message: "名称最大为20字", trigger: "blur"}
{ required: true, message: "请输入名称", trigger: "blur" }
],
describe: [
{ required: true, message: "请输入描述", trigger: "blur" },
......
......@@ -17,7 +17,7 @@
<el-input v-model="contactForm.contact_email"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input type="textarea" :rows="3" v-model="contactForm.remark" />
<el-input type="textarea" :rows="3" v-model="contactForm.remark" show-word-limit maxlength="300"/>
</el-form-item>
</el-form>
</template>
......@@ -44,37 +44,47 @@ const props = defineProps({
});
const checkPhone = (rule, value, callback) => {
var phone_ruler = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/;
setTimeout(() => {
if (!phone_ruler.test(value)&&value.length!==0) {
callback(new Error("请输入正确的手机号码"));
} else {
callback();
}
});
var phone_ruler = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/;
setTimeout(() => {
if (!phone_ruler.test(value)&&value.length!==0) {
callback(new Error("请输入正确的手机号码"));
} else {
callback();
}
});
};
const checkPhoneRepet = (rule, value, callback) => {
let params = null;
if (props.id){
params = {id: parseInt(props.id),contact_phone: value,}
}else {
params = {id: 0,contact_phone: value}
}
let params = null;
if (props.id){
params = {id: parseInt(props.id),contact_phone: value,}
}else {
params = {id: 0,contact_phone: value}
}
$axios.post(`/apaas/system/v5/org/check`,params)
.then((res) => {
if (res.data.code == 200) {
callback()
}else {
callback(new Error(res.data.data))
}
})
}
$axios.post(`/apaas/system/v5/org/check`,params)
.then((res) => {
if (res.data.code == 200) {
callback()
}else {
callback(new Error(res.data.data))
}
})
}
const checkName = (rule, value, callback) => {
var reg = /^[a-zA-Z0-9\u4e00-\u9fa5]+$/
if (!reg.test(value)) {
callback(new Error("只能输入字母、数字和汉字"))
}else {
callback()
}
}
const contactFormRules = reactive({
contact_name: [
{ required: true, message: '请输入联系人姓名', trigger: 'blur' },
{ max: 50, message: "联系人姓名最大长度为50个字符", trigger: "blur"},
{ validator: checkName, trigger: 'blur' },
],
contact_phone: [
{ required: true, message: '请输入联系人手机号', trigger: 'blur' },
......@@ -83,6 +93,7 @@ const contactFormRules = reactive({
],
contact_email: [
{ type: 'email', message: '请输入正确的邮箱', trigger: 'blur' },
{ max: 100, message: "邮箱最大长度为100个字符", trigger: "blur"},
]
})
const contactRef = ref(null)
......
......@@ -191,7 +191,7 @@ const getDetail = () => {
systemFormRef.value.setForm({
organization_id: form.organization_id,
system_role_id: form.system_role_id,
logo: [{url:form.logo}],
logo: form.logo ? [{url:form.logo}] : [],
business_code: form.business_code,
business_name: form.business_name,
business_desc: form.business_desc,
......
......@@ -29,7 +29,7 @@
<bg-upload-image v-model="systemForm.logo" :showTips="true" :limit="1" :fileSize="500" :fileSizeUnit="'KB'" listType="picture-card" :accept="['.jpg','.jpeg','.png']" customTips="请选择图片上传:大小120 * 120像素支持jpg、png等格式,图片需小于500KB"></bg-upload-image>
</el-form-item>
<el-form-item label="业务系统概述" prop="business_desc">
<el-input type="textarea" :rows="3" v-model="systemForm.business_desc" />
<el-input type="textarea" :rows="3" v-model="systemForm.business_desc" show-word-limit maxlength="300" />
</el-form-item>
<el-form-item label="角色" prop="system_role_id" v-if="!formType">
<el-select v-model="systemForm.system_role_id" placeholder="请选择角色" :disabled="true" style="width: 100%">
......@@ -118,39 +118,49 @@ const validatePass = (rule, value, callback) => {
}
}
const validateBusinessName = (rule, value, callback) => {
let params = null;
if (props.id){
params = {id: parseInt(props.id),business_name: value,organization_id: systemForm.organization_id}
}else {
params = {business_name: value,organization_id: systemForm.organization_id}
}
$axios.post(`/apaas/system/v5/user/check/business`,params)
.then((res) => {
if (res.data.code == 200) {
callback()
}else {
let reg = /^[a-zA-Z0-9\u4e00-\u9fa5]+$/
if (!reg.test(value)) {
callback(new Error("只能输入字母、数字和汉字"))
}else {
let params = null;
if (props.id){
params = {id: parseInt(props.id),business_name: value,organization_id: systemForm.organization_id}
}else {
params = {business_name: value,organization_id: systemForm.organization_id}
}
$axios.post(`/apaas/system/v5/user/check/business`,params)
.then((res) => {
if (res.data.code == 200) {
callback()
}else {
callback(new Error(res.data.data))
}
})
}
})
}
}
const validateSystemAccount = (rule, value, callback) => {
let params = null;
if (props.id){
params = {id: parseInt(props.id),system_account: value,}
}else {
params = {system_account: value}
}
$axios.post(`/apaas/system/v5/user/check/account`,params)
.then((res) => {
if (res.data.code == 200) {
callback()
}else {
let reg = /^[a-zA-Z0-9]+$/
if (!reg.test(value)) {
callback(new Error("只能输入字母和数字"))
}else {
let params = null;
if (props.id){
params = {id: parseInt(props.id),system_account: value,}
}else {
params = {system_account: value}
}
$axios.post(`/apaas/system/v5/user/check/account`,params)
.then((res) => {
if (res.data.code == 200) {
callback()
}else {
callback(new Error(res.data.data))
}
})
}
})
}
}
const formRules = reactive({
......@@ -159,6 +169,7 @@ const formRules = reactive({
],
business_name: [
{ required: true, message: '请输入业务系统名称', trigger: 'blur' },
{ max: 50, message: '业务系统名称最大长度为50个字符', trigger: 'blur' },
{ validator: validateBusinessName, trigger: 'blur' },
],
system_role_id: [
......@@ -166,16 +177,24 @@ const formRules = reactive({
],
system_account: [
{ required: true, message: '请输入账号', trigger: 'blur' },
{ min: 4,message: '帐号长度不得低于4个字符',trigger: 'blur' },
{ max: 20,message: '帐号最大长度为20个字符',trigger: 'blur' },
{ validator: validateSystemAccount, trigger: 'blur' },
],
password: [
{ required: true, message: '请输入密码', trigger: 'blur' },
{min: 8,message: '密码长度不得低于8位',trigger: 'blur'}
{ min: 8,message: '密码长度不得低于8位',trigger: 'blur' }
],
confirm_password: [
{ required: true, message: '请确认密码', trigger: 'blur' },
{ validator: validatePass, trigger: 'blur' }
],
access_address: [
{ max: 500,message: '访问地址最大长度为500个字符',trigger: 'blur' },
],
develop_id: [
{ required: true, message: "请选择开发厂商", trigger: "change"}
]
})
const systemRef = ref(null)
......@@ -258,14 +277,13 @@ const getRoleList = () => {
const getFirmList = () => {
$axios.get(`/apaas/system/v5/dictionary/developer/list`)
.then((res) => {
.then((res) => {
if (res.data.code == 200) {
firmList.value = res.data.data;
firmList.value = res.data.data || [];
}else {
$message.error(res.data.data)
}
})
})
}
onBeforeMount(() =>{
......
......@@ -217,17 +217,16 @@ import CryptoJS from "crypto-js";
{
label: "业务系统编码",
prop: "business_code",
width: 180
minWidth: 160
},
{
label: "业务系统名称",
prop: "business_name",
minWidth: 180
minWidth: 160
},
{
label: "账号",
prop: "system_account",
width: 150
},
{
label: "所属机构",
......@@ -242,7 +241,6 @@ import CryptoJS from "crypto-js";
{
label: "是否启用",
prop: "state",
width: 80
},
{
label: "操作",
......@@ -557,7 +555,7 @@ import CryptoJS from "crypto-js";
}
const clearSelected = () => {
dataTable.value.clearSelection();
dataTable.value.clearTable();
}
......
......@@ -300,7 +300,7 @@ const fileAction = (val,data,parent,disabled=false) => {
let newChild = {
menu_name: "新菜单", // 菜单名称
menu_id: 'new' + state.newMenuId, // 菜单id,用于新增后选中
menu_type: !parent ? 0 : parent.menu_type == 0 ? 0 : parent.menu_type == 1 ? 1 : 2, // 新增本级的类型
menu_type: !parent ? 0 : parent.menu_type == 0 ? 0 : 2, // 新增本级的类型
dict_group_id: parent ? parent.dict_group_id : "", // 父级的分组 有则继承,无则自选
state: 1, // 启用状态
menu_url: "", // 路径
......@@ -320,7 +320,7 @@ const fileAction = (val,data,parent,disabled=false) => {
let newChild = {
menu_name: "新菜单",
menu_id: 'new' + state.newMenuId,
menu_type: data.menu_type == 0 ? 0 : data.menu_type == 1 ? 1 : 2,
menu_type: data.menu_type == 0 ? 0 : 2,
dict_group_id: data.dict_group_id,
state: 1,
menu_url: "",
......
......@@ -14,7 +14,7 @@
<el-form-item label="类型" prop="menu_type" v-if="!topLevel">
<el-radio-group v-model="menuForm.menu_type" :disabled="radioDisabled">
<el-radio :label="0" :disabled="typeDisFlag != 0">目录</el-radio>
<el-radio :label="1" :disabled="typeDisFlag == 2">菜单</el-radio>
<el-radio :label="1" :disabled="typeDisFlag != 2 && typeDisFlag != 0">菜单</el-radio>
<el-radio :label="2">子页面</el-radio>
</el-radio-group>
</el-form-item>
......
......@@ -27,9 +27,22 @@
</div>
<div class="flex_right">
<div class="info_container bgc_white">
<div class="title"><span class="icon_box"><bg-icon class="step_icon" icon="#bg-ic-file"></bg-icon></span> 基本信息 <bg-icon style="font-size: 14px" class="step_icon" icon="#bg-ic-arrow-right"></bg-icon> </div>
<bg-info v-if="selectTreeDataType === 1" :data="baseInfo"></bg-info>
<bg-info v-if="selectTreeDataType === 2" :data="baseInfo2"></bg-info>
<div class="title">
<span class="icon_box">
<span class="step_icon">
<bg-icon icon="#bg-ic-file"></bg-icon>
</span>
<span>
基本信息
</span>
</span>
<span class="can_click_text detail_btn" v-if="selectTreeDataType === 1" @click="toOrgDetail">
查看详情
<bg-icon style="font-size: 8px; color: #95a3ca; vertical-align: middle" icon="#bg-ic-arrow-right" />
</span>
</div>
<bg-info class="info_box" v-if="selectTreeDataType === 1" :data="baseInfo"></bg-info>
<bg-info class="info_box" v-if="selectTreeDataType === 2" :data="baseInfo2"></bg-info>
</div>
<div class="main_container bgc_white">
<bg-filter-group @search="changeSearch" v-model="filter.key_word" placeholder="请输入关键字">
......@@ -880,7 +893,7 @@ import { downloadFileFormatNew } from '@/services/helper'
}
const clearSelected = () => {
dataTable.value.clearSelection();
dataTable.value.clearTable();
}
......@@ -932,13 +945,33 @@ import { downloadFileFormatNew } from '@/services/helper'
color: #202531;
font-weight: bold;
margin-bottom: 10px;
max-width: 960px;
display: flex;
justify-content: space-between;
align-items: center;
}
.detail_btn {
font-size: 14px;
font-weight: normal;
}
.icon_box {
background-color: rgb(42, 74, 167);
color: rgb(255, 255, 255);
padding: 2px 4px;
border-radius: 4px;
font-size: 14px;
display: flex;
align-items: center;
}
.step_icon {
display: inline-block;
width: 20px;
height: 20px;
text-align: center;
line-height: 20px;
background-color: #2a4aa7;
color: #fff;
border-radius: 4px;
font-size: 14px;
margin-right: 8px;
}
.info_box {
max-width: 960px;
}
.main_container {
flex: 1;
......@@ -969,7 +1002,7 @@ import { downloadFileFormatNew } from '@/services/helper'
bottom: unset
}
.dialog_form {
padding: 16px;
padding: 24px 8px 6px;
}
</style>
\ No newline at end of file
......@@ -5,7 +5,6 @@
:model="orgForm"
:rules="formRules"
ref="orgRef"
style="max-width: 80%"
>
<el-form-item label="上级目录" prop="p_organization_id" v-if="formType === 'create'">
<el-tree-select
......@@ -27,12 +26,16 @@
<el-input v-model="orgForm.organization_code" />
</el-form-item>
<el-form-item label="组织介绍" prop="description">
<el-input type="textarea" :rows="3" v-model="orgForm.description" />
<el-input type="textarea" :rows="3" v-model="orgForm.description" maxlength="300" show-word-limit />
</el-form-item>
<el-form-item label="组织附件" prop="logo">
<bg-upload v-model="orgForm.attachment" customTips :limit="3"
:fileTypes="['doc','docx','xls','xlsx','pdf','jpg','jpeg','png','zip','rar']"
:otherInfo="'最多可上传三个附件,可上传zip,rar,doc,docx,xlsx,xls,png,jpg,可上传营业执照和相关协议文件等'">
<bg-upload
v-model="orgForm.attachment"
customTips
:limit="3"
:fileTypes="['doc','docx','xls','xlsx','pdf','jpg','jpeg','png','zip','rar']"
:otherInfo="'最多可上传三个附件,可上传zip,rar,doc,docx,xlsx,xls,png,jpg,可上传营业执照和相关协议文件等'"
>
<span>将文件拖到此处,或 点击上传</span>
</bg-upload>
</el-form-item>
......@@ -41,105 +44,119 @@
<script setup>
import { reactive, ref, onMounted, onBeforeMount, getCurrentInstance } from 'vue'
const props = defineProps({
const props = defineProps({
formType: {
type: String,
default: 'create', //false 新建 true 编辑
},
});
const { proxy } = getCurrentInstance()
const { $axios,$message } = proxy
const orgForm = reactive({
p_organization_id: '',
level: false,
name: '',
organization_code: '',
description: '',
attachment: []
})
const formRules = reactive({
p_organization_id: [
{ required: true, message: '输入上级目录', trigger: 'blur' },
],
name: [
{ required: true, message: '请输入机构名称', trigger: 'blur' },
],
organization_code: [
{ required: true, message: '请输入组织机构代码', trigger: 'blur' },
],
})
type: String,
default: 'create', //false 新建 true 编辑
},
});
const { proxy } = getCurrentInstance()
const { $axios,$message } = proxy
const orgForm = reactive({
p_organization_id: '',
level: false,
name: '',
organization_code: '',
description: '',
attachment: []
})
const orgRef = ref(null)
const emit = defineEmits(['action'])
const checkCode = (rule, value, callback) => {
var reg = /^[a-zA-Z0-9]+$/
if (!reg.test(value)) {
callback(new Error("只能输入字母和数字"))
}else {
callback()
}
}
const submitForm = async () => {
if (!orgRef) return
await orgRef.value.validate((valid, fields) => {
if (valid) {
emit('action', orgForm)
} else {
emit('action',null)
}
})
const checkName = (rule, value, callback) => {
var reg = /^[a-zA-Z\u4e00-\u9fa5]+$/
if (!reg.test(value)) {
callback(new Error("只能输入字母和汉字"))
}else {
callback()
}
}
const clearForm = () => {
if (!orgRef) return
orgRef.value.resetFields()
}
const formRules = reactive({
p_organization_id: [
{ required: true, message: '输入上级目录', trigger: 'blur' },
],
name: [
{ required: true, message: '请输入机构名称', trigger: 'blur' },
{ max: 50, message: '机构名称最大长度为50位', trigger: 'blur' },
{ validator: checkName, trigger: 'blur' }
],
organization_code: [
{ required: true, message: '请输入组织机构代码', trigger: 'blur' },
{ max: 18, message: '组织机构代码最大长度为18位', trigger: 'blur' },
{ validator: checkCode, trigger: 'blur' }
],
})
const setForm = (data) => {
Object.assign(orgForm, data);
}
const orgRef = ref(null)
const emit = defineEmits(['action'])
const orgData = ref([])
const treeProps = {
label: 'name',
children: 'Child',
value: 'organization_id',
disabled: 'disabled'
}
const getOrgTree = () => {
$axios.get(`/apaas/system/v5/org/tree`)
.then((res) => {
const submitForm = async () => {
if (!orgRef) return
await orgRef.value.validate((valid, fields) => {
if (valid) {
emit('action', orgForm)
} else {
emit('action',null)
}
})
}
const clearForm = () => {
if (!orgRef) return
orgRef.value.resetFields()
}
const setForm = (data) => {
Object.assign(orgForm, data);
}
const orgData = ref([])
const treeProps = {
label: 'name',
children: 'Child',
value: 'organization_id',
disabled: 'disabled'
}
const getOrgTree = () => {
$axios.get(`/apaas/system/v5/org/tree`)
.then((res) => {
if (res.data.code == 200) {
const orgDataTemp = res.data.data || []
orgDataTemp.shift()
orgData.value = filterOrg(orgDataTemp);
const orgDataTemp = res.data.data || []
orgDataTemp.shift()
orgData.value = filterOrg(orgDataTemp);
}else {
$message.error(res.data.data)
$message.error(res.data.data)
}
})
}
const filterOrg = (data) => {
if(data.length > 0) {
data.forEach(item => {
item.disabled = item.data_type === 0 ? false : true;
})
}
if(item.Child){
filterOrg(item.Child)
}else {
return
}
})
const filterOrg = (data) => {
if(data.length > 0) {
data.forEach(item => {
item.disabled = item.data_type === 0 ? false : true;
if(item.Child){
filterOrg(item.Child)
}else {
return
}
return data;
}
const isTop = (data) => {
orgForm.p_organization_id = data ? ' ' : ''; //空格绕过表单非空校验
})
}
return data;
}
onBeforeMount(() => {
getOrgTree()
})
onMounted(() => {
})
const isTop = (data) => {
orgForm.p_organization_id = data ? ' ' : ''; //空格绕过表单非空校验
}
onBeforeMount(() => {
getOrgTree()
})
onMounted(() => {})
defineExpose({ submitForm, clearForm, setForm })
</script>
\ No newline at end of file
......@@ -4,7 +4,7 @@
<el-breadcrumb separator="/">
<el-breadcrumb-item> 组织管理 </el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: '/system/organization' }"> 组织管理 </el-breadcrumb-item>
<el-breadcrumb-item> 新增组织管理员 </el-breadcrumb-item>
<el-breadcrumb-item> {{route.query.id ? '编辑组织用户':'新增组织管理员'}} </el-breadcrumb-item>
</el-breadcrumb>
</div>
<div class="page_content flex_cloumn">
......@@ -144,12 +144,14 @@ const getOrgPersonFormData = (data) => {
})
}else {
const params = {...formData,
// organization_id: orgId.value,
logo: formData.logo && formData.logo.length > 0 ? formData.logo[0].url : '',
is_admin: 2,
password: CryptoJS.AES.encrypt(formData.password,"swuE9cmCZQwrkYRV").toString()
};
const params = {
...formData,
// organization_id: orgId.value,
logo: formData.logo && formData.logo.length > 0 ? formData.logo[0].url : '',
is_admin: 2,
password: CryptoJS.AES.encrypt(formData.password,"swuE9cmCZQwrkYRV").toString()
};
params.document_type = params.document_type == "" ? 0 : params.document_type
$axios.post(`/apaas/system/v5/org/add/user`,params)
.then((res) => {
if (res.data.code == 200) {
......@@ -190,7 +192,7 @@ const getDetail = () => {
orgAccountRef.value.setForm({
organization_id: form.organization_id,
select_role: form.select_role,
logo: [{url:form.logo}],
logo: form.logo ? [{url:form.logo}] : [],
system_account: form.system_account,
contact_phone: form.contact_phone,
state: form.state,
......@@ -199,7 +201,7 @@ const getDetail = () => {
orgPersonRef.value.setForm({
contact_name: form.contact_name,
document_type: form.document_type,
document_type: form.document_type ? form.document_type : "",
document_number: form.document_number,
contact_email: form.contact_email,
remark: form.remark,
......
......@@ -4,7 +4,7 @@
<el-breadcrumb separator="/">
<el-breadcrumb-item> 组织管理 </el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: '/system/organization' }"> 组织管理 </el-breadcrumb-item>
<el-breadcrumb-item> 新增平台用户 </el-breadcrumb-item>
<el-breadcrumb-item> {{route.query.id ? '编辑平台用户':'新增平台用户'}} </el-breadcrumb-item>
</el-breadcrumb>
</div>
<div class="page_content flex_cloumn">
......@@ -217,7 +217,7 @@ const getDetail = () => {
if (res.data.code == 200) {
const form = res.data.data;
platformAccountFormRef.value.setForm({
logo: [{url:form.logo}],
logo: form.logo ? [{url:form.logo}] : [],
system_account: form.system_account,
contact_phone: form.contact_phone,
state: form.state,
......
......@@ -146,7 +146,7 @@
</template>
</el-cascader>
<el-input
v-model="userFilter.search"
v-model.trim="userFilter.search"
placeholder="请输入内容"
style="width: 200px"
:prefix-icon="Search"
......@@ -339,6 +339,9 @@ const changeSearch = (val) => {
} // 表格关键字筛选
const changeUseRow = (row) => {
if (row.role_type == 1 || row.role_type == 2) {
return
}
axios
.post(`/apaas/system/v5/role/state/${row.id}/${row.state}`)
.then((res) => {
......
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