push
This commit is contained in:
8
nervui-work-order/.env
Normal file
8
nervui-work-order/.env
Normal file
@@ -0,0 +1,8 @@
|
||||
# port
|
||||
VITE_PORT = 4209
|
||||
|
||||
# spa-title
|
||||
VITE_GLOB_APP_TITLE = nervui-work-order
|
||||
|
||||
# spa shortname
|
||||
VITE_GLOB_APP_SHORT_NAME = nervui-work-order
|
||||
22
nervui-work-order/.env.development
Normal file
22
nervui-work-order/.env.development
Normal file
@@ -0,0 +1,22 @@
|
||||
# Whether to open mock
|
||||
VITE_USE_MOCK = true
|
||||
|
||||
# public path
|
||||
VITE_PUBLIC_PATH = /nervui-work-order/
|
||||
|
||||
# Cross-domain proxy, you can configure multiple
|
||||
# Please note that no line breaks
|
||||
VITE_PROXY = {"/api": { "target": "http://portal.cloud.dev2.dingcloud.com:30080", "changeOrigin": true }}
|
||||
# VITE_PROXY=[["/api","https://vvbin.cn/test"]]
|
||||
|
||||
# Delete console
|
||||
VITE_DROP_CONSOLE = false
|
||||
|
||||
# Basic interface address SPA
|
||||
VITE_GLOB_API_URL=/basic-api
|
||||
|
||||
# File upload address, optional
|
||||
VITE_GLOB_UPLOAD_URL=/upload
|
||||
|
||||
# Interface prefix
|
||||
VITE_GLOB_API_URL_PREFIX=
|
||||
35
nervui-work-order/.env.production
Normal file
35
nervui-work-order/.env.production
Normal file
@@ -0,0 +1,35 @@
|
||||
# Whether to open mock
|
||||
VITE_USE_MOCK = true
|
||||
|
||||
# public path
|
||||
VITE_PUBLIC_PATH = /nervui-work-order/
|
||||
|
||||
# Delete console
|
||||
VITE_DROP_CONSOLE = true
|
||||
|
||||
# Whether to enable gzip or brotli compression
|
||||
# Optional: gzip | brotli | none
|
||||
# If you need multiple forms, you can use `,` to separate
|
||||
VITE_BUILD_COMPRESS = 'none'
|
||||
|
||||
# Whether to delete origin files when using compress, default false
|
||||
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
|
||||
|
||||
# Basic interface address SPA
|
||||
VITE_GLOB_API_URL=/basic-api
|
||||
|
||||
# File upload address, optional
|
||||
# It can be forwarded by nginx or write the actual address directly
|
||||
VITE_GLOB_UPLOAD_URL=/upload
|
||||
|
||||
# Interface prefix
|
||||
VITE_GLOB_API_URL_PREFIX=
|
||||
|
||||
# Whether to enable image compression
|
||||
VITE_USE_IMAGEMIN= true
|
||||
|
||||
# use pwa
|
||||
VITE_USE_PWA = false
|
||||
|
||||
# Is it compatible with older browsers
|
||||
VITE_LEGACY = false
|
||||
1
nervui-work-order/.version
Normal file
1
nervui-work-order/.version
Normal file
@@ -0,0 +1 @@
|
||||
0.0.1
|
||||
74
nervui-work-order/build.sh
Normal file
74
nervui-work-order/build.sh
Normal file
@@ -0,0 +1,74 @@
|
||||
#!/bin/bash
|
||||
SOURCE="$0"
|
||||
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
|
||||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||
SOURCE="$(readlink "$SOURCE")"
|
||||
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
||||
done
|
||||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||
|
||||
if [ -z $WORKSPACE ];then
|
||||
echo "WORKSPACE not exists"
|
||||
else
|
||||
set DIR=$WORKSPACE
|
||||
fi
|
||||
|
||||
echo "current dir"
|
||||
echo "$DIR"
|
||||
|
||||
cd "$DIR"
|
||||
projectname=$(basename `pwd`)
|
||||
|
||||
npm run work-order-build
|
||||
|
||||
if [ -d "$DIR/dist" ];then
|
||||
|
||||
cd "$DIR/dist"
|
||||
|
||||
# copy module.json
|
||||
cp ../module.json ./
|
||||
|
||||
# package
|
||||
VERSION=$(cat ../.version)
|
||||
lastdir=../release/
|
||||
if [ -d ${lastdir} ];then
|
||||
echo "删除旧release文件夹"
|
||||
rm -rf ${lastdir}
|
||||
else
|
||||
echo "文件夹不存在!"
|
||||
fi
|
||||
mkdir -p ${lastdir}
|
||||
|
||||
dir=../release/nerv/$projectname/$VERSION
|
||||
mkdir -p ${dir}
|
||||
tar -zcvf "${dir}/$projectname-$VERSION.tgz" ./*
|
||||
|
||||
templatedir=../release/resources/templates/nerv/$projectname/$VERSION/$projectname
|
||||
mkdir -p ${templatedir}
|
||||
cp -r ../resources/templates/* ${templatedir}
|
||||
|
||||
cd ../
|
||||
|
||||
releasefile=nerv-$projectname-$VERSION.tgz
|
||||
if [ -f ${releasefile} ];then
|
||||
echo "删除旧包!"
|
||||
rm -rf ${releasefile}
|
||||
fi
|
||||
|
||||
tar -zcvf ${releasefile} ./release/* release.yaml
|
||||
|
||||
mkdir -p ./release/nervui
|
||||
cp -r ./release/nerv/* ./release/nervui
|
||||
|
||||
if [ -f ${releasefile} ];then
|
||||
echo "编译成功!"
|
||||
mv ${releasefile} ./release
|
||||
else
|
||||
echo "编译失败!!!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
else
|
||||
echo "编译失败!!!"
|
||||
exit 1
|
||||
fi
|
||||
15
nervui-work-order/index.html
Normal file
15
nervui-work-order/index.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!-- @format -->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link href="/favicon.ico" rel="icon" />
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
|
||||
<title>工单管理后台</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script src="./src/main.ts" type="module"></script>
|
||||
</body>
|
||||
</html>
|
||||
21
nervui-work-order/module.json
Normal file
21
nervui-work-order/module.json
Normal file
@@ -0,0 +1,21 @@
|
||||
[
|
||||
{
|
||||
"catalog": "大数据",
|
||||
"icon": "",
|
||||
"name": "work-order",
|
||||
"label": "工单管理后台",
|
||||
"menus": [
|
||||
{
|
||||
"name": "task",
|
||||
"url": "/work-order/task",
|
||||
"label": "工单管理"
|
||||
},
|
||||
{
|
||||
"name": "employee",
|
||||
"url": "/work-order/employee",
|
||||
"label": "员工管理"
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
]
|
||||
9
nervui-work-order/offline-release.json
Normal file
9
nervui-work-order/offline-release.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"release": [
|
||||
{
|
||||
"src": "nervui-work-order/release",
|
||||
"dest": "/upload/pkg",
|
||||
"include": ["nervui-work-order-(\\d+).(\\d+).(\\d+)(|-\\w+).tar.gz"]
|
||||
}
|
||||
]
|
||||
}
|
||||
31
nervui-work-order/offline.sh
Normal file
31
nervui-work-order/offline.sh
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
SOURCE="$0"
|
||||
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
|
||||
DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
|
||||
SOURCE="$(readlink "$SOURCE")"
|
||||
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
||||
done
|
||||
DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
|
||||
|
||||
cd "$DIR" || exit
|
||||
|
||||
VERSION=$(cat "$(pwd)"/.version)
|
||||
sed "s|\${VERSION}|${VERSION}|g" "$(pwd)"/offline.tpl.yaml > "$(pwd)"/offline.yaml || exit 1
|
||||
|
||||
|
||||
releaseDir="./release/nervui/nerv/nervui-work-order-offline"
|
||||
rm -rf $releaseDir
|
||||
version="${VERSION}-$(cat "$(pwd)"/offline.version)"
|
||||
|
||||
set -x
|
||||
docker run --rm -i \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v "$(pwd)"/offline.yaml:/app/build.yaml \
|
||||
-v "$(pwd)/$releaseDir":/app/output \
|
||||
-e name=nervui-work-order \
|
||||
-e version="$version" \
|
||||
--pull=always \
|
||||
registry.nervhub.nervstack.io/nerv3/deploy:latest
|
||||
|
||||
rm -rf $releaseDir/output
|
||||
5
nervui-work-order/offline.tpl.yaml
Normal file
5
nervui-work-order/offline.tpl.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
images:
|
||||
helm:
|
||||
- name: nervui-work-order
|
||||
version: "${VERSION}"
|
||||
repository: "https://registry.nervhub.nervstack.io/chartrepo/nerv3-ui"
|
||||
1
nervui-work-order/offline.version
Normal file
1
nervui-work-order/offline.version
Normal file
@@ -0,0 +1 @@
|
||||
alpha001
|
||||
BIN
nervui-work-order/public/asset/image/login/login-background.jpeg
Normal file
BIN
nervui-work-order/public/asset/image/login/login-background.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 126 KiB |
BIN
nervui-work-order/public/asset/image/login/logo-data.png
Normal file
BIN
nervui-work-order/public/asset/image/login/logo-data.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
BIN
nervui-work-order/public/asset/image/login/logo-paas.png
Normal file
BIN
nervui-work-order/public/asset/image/login/logo-paas.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
BIN
nervui-work-order/public/favicon.ico
Normal file
BIN
nervui-work-order/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
11
nervui-work-order/release.yaml
Normal file
11
nervui-work-order/release.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
# 上传release目录信息到nerv-file仓库
|
||||
release:
|
||||
- { src: release, dest: /upload/pkg, include: ['.*(.tgz)$'] }
|
||||
- { src: release/resources/templates, dest: /upload/templates }
|
||||
register:
|
||||
name: nervui-work-order
|
||||
version: 0.0.1
|
||||
components:
|
||||
- type: nervui-work-order
|
||||
resources:
|
||||
- { type: template, relativePath: /nervui-work-order/deploy.json }
|
||||
9
nervui-work-order/src/App.vue
Normal file
9
nervui-work-order/src/App.vue
Normal file
@@ -0,0 +1,9 @@
|
||||
<!-- @format -->
|
||||
|
||||
<template>
|
||||
<div class="vm-app">
|
||||
<ns-application />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less"></style>
|
||||
22
nervui-work-order/src/api/index.ts
Normal file
22
nervui-work-order/src/api/index.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* 配置接口 格式 module:Array<resource>
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
export const apiModule = {
|
||||
pension: ['User', 'CurrentUser'],
|
||||
};
|
||||
|
||||
const BASE_URL = '/api/work/objs';
|
||||
|
||||
export const API = {
|
||||
taskAdd: `${BASE_URL}/consult/workOrder`,
|
||||
taskEdit: `${BASE_URL}/consult/edit`,
|
||||
tastDetail: `${BASE_URL}/consult/get`,
|
||||
tastDelete: `${BASE_URL}/consult/delete`,
|
||||
job: `${BASE_URL}/consult/job`,
|
||||
industry: `${BASE_URL}/consult/industry`,
|
||||
employee: `${BASE_URL}/employee/drop`,
|
||||
close: `${BASE_URL}/consult/close`,
|
||||
};
|
||||
3
nervui-work-order/src/common/index.ts
Normal file
3
nervui-work-order/src/common/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
/** @format */
|
||||
|
||||
export default {};
|
||||
29
nervui-work-order/src/common/utils/index.ts
Normal file
29
nervui-work-order/src/common/utils/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
/** @format */
|
||||
|
||||
// 判断值是否为空
|
||||
const isEmpty = (value: any) => {
|
||||
if (value === undefined || value === null || value === '' || JSON.stringify(value) === '{}') {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
// ram单位转换
|
||||
const flavornewUnit = function (value: number, unit: string) {
|
||||
let newVal = value;
|
||||
let newUnit = unit;
|
||||
if (value >= 1024 && !unit) {
|
||||
newUnit = 'MB';
|
||||
newVal = Number((newVal / 1024 / 1024).toFixed(2));
|
||||
}
|
||||
if (newVal >= 1024 && newUnit == 'MB') {
|
||||
newUnit = 'GB';
|
||||
newVal = Number((newVal / 1024).toFixed(2));
|
||||
}
|
||||
if (newVal >= 1024 && newUnit == 'GB') {
|
||||
newUnit = 'TB';
|
||||
newVal = Number((newVal / 1024).toFixed(2));
|
||||
}
|
||||
return Number(newVal) + newUnit;
|
||||
};
|
||||
export { isEmpty, flavornewUnit };
|
||||
169
nervui-work-order/src/components/modal-add-form.vue
Normal file
169
nervui-work-order/src/components/modal-add-form.vue
Normal file
@@ -0,0 +1,169 @@
|
||||
<!-- @format -->
|
||||
|
||||
<template>
|
||||
<a-spin class="ns-view-spinning" :spinning="isLoading" :key="'addForm_' + $route.name">
|
||||
<div class="ns-add-form">
|
||||
<ns-form ref="nsFormElRef" v-bind="getBindValue">
|
||||
<template #[item]="data" v-for="item in Object.keys($slots)">
|
||||
<slot :name="item" v-bind="data || {}"></slot>
|
||||
</template>
|
||||
</ns-form>
|
||||
</div>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, PropType, ref } from 'vue';
|
||||
import { http } from '/nerv-lib/util/http';
|
||||
import { NsMessage } from '/nerv-lib/component/message';
|
||||
import { useNavigate } from '/nerv-lib/use/use-navigate';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { Action, useAction } from '/nerv-lib/use';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { CaretDownOutlined } from '@ant-design/icons-vue';
|
||||
import { useApi, HttpRequestConfig } from '/nerv-lib/use/use-api';
|
||||
|
||||
interface ColumnActions {
|
||||
back: Boolean;
|
||||
actions: Action[];
|
||||
}
|
||||
export default defineComponent({
|
||||
name: 'NsViewAddForm',
|
||||
components: {
|
||||
CaretDownOutlined,
|
||||
},
|
||||
props: {
|
||||
api: {
|
||||
type: [String, Function],
|
||||
required: true,
|
||||
},
|
||||
sticky: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
title: String,
|
||||
params: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
dataHandle: Function,
|
||||
okText: {
|
||||
type: String,
|
||||
default: '保 存',
|
||||
},
|
||||
cancelText: {
|
||||
type: String,
|
||||
default: '返 回',
|
||||
},
|
||||
headActions: {
|
||||
type: Object as PropType<ColumnActions>,
|
||||
default: () => ({
|
||||
actions: [],
|
||||
}),
|
||||
},
|
||||
},
|
||||
setup(props, { attrs }) {
|
||||
const nsFormElRef = ref(null);
|
||||
const isLoading = ref(false);
|
||||
const { navigateBack } = useNavigate();
|
||||
const route = useRoute();
|
||||
const { httpRequest } = useApi();
|
||||
const getData = computed(() => {
|
||||
return {
|
||||
...route.query,
|
||||
...route.params,
|
||||
formRef: nsFormElRef.value,
|
||||
};
|
||||
});
|
||||
|
||||
const getBindValue = computed(() => ({
|
||||
...attrs,
|
||||
...props,
|
||||
title: '',
|
||||
}));
|
||||
|
||||
const validateResult = computed(() => {
|
||||
return nsFormElRef.value?.validateResult;
|
||||
});
|
||||
|
||||
function submit() {
|
||||
return new Promise((resolve, reject) => {
|
||||
nsFormElRef.value
|
||||
.triggerSubmit()
|
||||
.then((data: any) => {
|
||||
isLoading.value = true;
|
||||
data = props.dataHandle ? props.dataHandle(data) : data;
|
||||
const { api } = props;
|
||||
const { params } = route;
|
||||
const requestConfig: HttpRequestConfig = { method: 'POST' };
|
||||
if (!api) {
|
||||
resolve(data);
|
||||
return;
|
||||
}
|
||||
httpRequest({ api, params: data, pathParams: params, requestConfig })
|
||||
.then((res) => {
|
||||
isLoading.value = false;
|
||||
NsMessage.success('操作成功', 1, () => {
|
||||
resolve(res);
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
reject(err);
|
||||
isLoading.value = false;
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
});
|
||||
}
|
||||
const { transformAction } = useAction();
|
||||
|
||||
const getActions = computed(() => {
|
||||
let actions = cloneDeep(props.headActions.actions);
|
||||
actions = actions.map((action) => {
|
||||
return transformAction(action, getData.value);
|
||||
});
|
||||
return actions;
|
||||
});
|
||||
|
||||
const getDropdownActions = (actions) => {
|
||||
actions = actions.map((action) => {
|
||||
return transformAction(action, getData.value);
|
||||
});
|
||||
return actions;
|
||||
};
|
||||
|
||||
return {
|
||||
nsFormElRef,
|
||||
validateResult,
|
||||
submit,
|
||||
getBindValue,
|
||||
isLoading,
|
||||
navigateBack,
|
||||
getActions,
|
||||
getDropdownActions,
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
:deep(.ns-page-header) {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
.ns-add-form {
|
||||
:deep(.ns-form) {
|
||||
padding: 24px 24px 12px;
|
||||
// 第一个子表单Title距离顶部为0
|
||||
&.ns-flex-form-vertical
|
||||
.ns-form-body:first-child
|
||||
.ns-form-item:first-child
|
||||
.ns-form-body
|
||||
.ns-child-form-title {
|
||||
padding-top: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
113
nervui-work-order/src/components/ns-modal-form.vue
Normal file
113
nervui-work-order/src/components/ns-modal-form.vue
Normal file
@@ -0,0 +1,113 @@
|
||||
<!-- @format -->
|
||||
|
||||
<template>
|
||||
<div class="modalStyle" ref="modalContainer">
|
||||
<ns-modal
|
||||
v-if="visible"
|
||||
:bodyStyle="{ padding: 0 }"
|
||||
:title="modalTitle"
|
||||
:getContainer="() => $refs.modalContainer"
|
||||
v-model:visible="visible"
|
||||
:ok-button-props="{ disabled: !validateResult }"
|
||||
@cancel="handleCancel"
|
||||
v-bind="modalConfig"
|
||||
@ok="handleOk">
|
||||
<ns-modal-add-form v-bind="formConfig" :model="data" formLayout="vertical" ref="addFormRef" />
|
||||
</ns-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, onMounted, ref, watch } from 'vue';
|
||||
import NsModalAddForm from '/@/components/modal-add-form.vue';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'NsModalForm',
|
||||
components: {
|
||||
NsModalAddForm,
|
||||
},
|
||||
setup(props, { attrs }) {
|
||||
const visible = ref(false);
|
||||
const addFormRef = ref();
|
||||
const formConfig: any = ref();
|
||||
const modalConfig: any = ref();
|
||||
const modalContainer = ref();
|
||||
const modalTitle = ref();
|
||||
const data = ref({});
|
||||
let reload: any = null;
|
||||
const validateResult = computed(() => {
|
||||
return addFormRef.value?.validateResult;
|
||||
});
|
||||
const handleOk = () => {
|
||||
// const { successCallBack } = props.modalConfig;
|
||||
addFormRef.value.submit().then((res) => {
|
||||
reload && reload();
|
||||
ifShow();
|
||||
});
|
||||
};
|
||||
const ifShow = () => {
|
||||
visible.value = !visible.value;
|
||||
};
|
||||
|
||||
const acceptFormConfig = (config, ELRef, record) => {
|
||||
console.log(config, ELRef, record);
|
||||
|
||||
const { detailHandle, title, modal } = config;
|
||||
modalTitle.value = title;
|
||||
// 表单配置
|
||||
formConfig.value = config;
|
||||
// 弹窗配置
|
||||
modalConfig.value = modal;
|
||||
reload = ELRef.reload;
|
||||
// 异步处理校验问题
|
||||
setTimeout(() => {
|
||||
let result = record;
|
||||
result = { ...result, ...config.model };
|
||||
data.value = detailHandle ? detailHandle(result) : result;
|
||||
console.log(data.value);
|
||||
}, 10);
|
||||
ifShow();
|
||||
};
|
||||
return {
|
||||
visible,
|
||||
validateResult,
|
||||
addFormRef,
|
||||
handleOk,
|
||||
ifShow,
|
||||
modalContainer,
|
||||
acceptFormConfig,
|
||||
formConfig,
|
||||
modalConfig,
|
||||
modalTitle,
|
||||
data,
|
||||
handleCancel: (e) => {
|
||||
console.log(e);
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-page-header),
|
||||
:deep(.page-title) {
|
||||
display: none;
|
||||
}
|
||||
:deep(.ns-form)::after {
|
||||
height: 0 !important;
|
||||
}
|
||||
:deep(.add-form) {
|
||||
padding: 24px 24px 12px;
|
||||
}
|
||||
:deep(.ant-form-item-control-input-content) {
|
||||
.ant-input-affix-wrapper,
|
||||
.ant-select,
|
||||
.ant-input {
|
||||
// width: 100% !important;
|
||||
}
|
||||
}
|
||||
// :deep(.ant-col-20) {
|
||||
// flex: 1;
|
||||
// }
|
||||
</style>
|
||||
9
nervui-work-order/src/config/app.config.ts
Normal file
9
nervui-work-order/src/config/app.config.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/** @format */
|
||||
|
||||
export const appConfig = {
|
||||
projectType: 'web',
|
||||
baseApi: '/api',
|
||||
baseHeader: '/home',
|
||||
baseRouter: '/home/index',
|
||||
timeout: 60 * 1000,
|
||||
};
|
||||
5
nervui-work-order/src/config/index.ts
Normal file
5
nervui-work-order/src/config/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
/** @format */
|
||||
|
||||
import { appConfig } from '/@/config/app.config';
|
||||
|
||||
export { appConfig };
|
||||
23
nervui-work-order/src/icon/noData.svg
Normal file
23
nervui-work-order/src/icon/noData.svg
Normal file
@@ -0,0 +1,23 @@
|
||||
<svg width="240" height="240" viewBox="0 0 240 240" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M118.392 154.493C143.026 154.493 162.996 150.761 162.996 146.158C162.996 141.556 143.026 137.824 118.392 137.824C93.7586 137.824 73.7891 141.556 73.7891 146.158C73.7891 150.761 93.7586 154.493 118.392 154.493Z"
|
||||
fill="#F5F5F7" fill-opacity="0.8"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M154.075 121.674L138.335 102.303C137.58 101.391 136.476 100.839 135.314 100.839H101.471C100.31 100.839 99.2057 101.391 98.4504 102.303L82.7109 121.674V131.795H154.076V121.674H154.075Z"
|
||||
fill="#AEB8C2"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M96.0456 75.8359H140.738C141.436 75.8359 142.106 76.1132 142.599 76.6067C143.093 77.1002 143.37 77.7696 143.37 78.4675V139.878C143.37 140.576 143.093 141.245 142.599 141.739C142.106 142.232 141.436 142.51 140.738 142.51H96.0456C95.3477 142.51 94.6784 142.232 94.1848 141.739C93.6913 141.245 93.4141 140.576 93.4141 139.878V78.4675C93.4141 77.7696 93.6913 77.1002 94.1848 76.6067C94.6784 76.1132 95.3477 75.8359 96.0456 75.8359V75.8359Z"
|
||||
fill="#F5F5F7"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M101.866 82.3838H134.917C135.266 82.3838 135.601 82.5224 135.847 82.7692C136.094 83.0159 136.233 83.3506 136.233 83.6996V100.119C136.233 100.468 136.094 100.802 135.847 101.049C135.601 101.296 135.266 101.434 134.917 101.434H101.866C101.517 101.434 101.183 101.296 100.936 101.049C100.689 100.802 100.55 100.468 100.55 100.119V83.6996C100.55 83.3506 100.689 83.0159 100.936 82.7692C101.183 82.5224 101.517 82.3838 101.866 82.3838ZM102.039 108.577H134.745C135.139 108.577 135.518 108.734 135.797 109.013C136.076 109.292 136.233 109.671 136.233 110.065C136.233 110.46 136.076 110.839 135.797 111.118C135.518 111.397 135.139 111.554 134.745 111.554H102.039C101.644 111.554 101.265 111.397 100.986 111.118C100.707 110.839 100.55 110.46 100.55 110.065C100.55 109.671 100.707 109.292 100.986 109.013C101.265 108.734 101.644 108.577 102.039 108.577ZM102.039 116.316H134.745C135.139 116.316 135.518 116.473 135.797 116.752C136.076 117.031 136.233 117.41 136.233 117.805C136.233 118.199 136.076 118.578 135.797 118.857C135.518 119.136 135.139 119.293 134.745 119.293H102.039C101.644 119.293 101.265 119.136 100.986 118.857C100.707 118.578 100.55 118.199 100.55 117.805C100.55 117.41 100.707 117.031 100.986 116.752C101.265 116.473 101.644 116.316 102.039 116.316ZM153.929 144.936C153.419 146.956 151.628 148.462 149.498 148.462H87.2853C85.155 148.462 83.3642 146.955 82.855 144.936C82.7579 144.551 82.7089 144.155 82.709 143.758V121.675H100.023C101.936 121.675 103.477 123.285 103.477 125.24V125.267C103.477 127.221 105.037 128.8 106.949 128.8H129.834C131.746 128.8 133.306 127.207 133.306 125.252V125.244C133.306 123.288 134.847 121.674 136.76 121.674H154.074V143.759C154.074 144.165 154.023 144.559 153.929 144.936Z"
|
||||
fill="#DCE0E6"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M156.105 76.9026L151.612 78.6461C151.496 78.6909 151.371 78.7023 151.249 78.6789C151.127 78.6555 151.015 78.5982 150.924 78.5137C150.834 78.4292 150.769 78.3208 150.737 78.2011C150.706 78.0813 150.708 77.9551 150.745 77.8368L152.02 73.7533C150.316 71.8164 149.316 69.4546 149.316 66.9059C149.316 60.3303 155.973 55 164.185 55C172.395 55 179.052 60.3303 179.052 66.9059C179.052 73.4816 172.395 78.8118 164.184 78.8118C161.205 78.8118 158.432 78.1105 156.105 76.9026Z"
|
||||
fill="#DCE0E6"/>
|
||||
<path d="M170.04 69.0555C171.076 69.0555 171.915 68.2264 171.915 67.2035C171.915 66.1807 171.076 65.3516 170.04 65.3516C169.005 65.3516 168.166 66.1807 168.166 67.2035C168.166 68.2264 169.005 69.0555 170.04 69.0555Z"
|
||||
fill="white"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M160.202 68.8238H156.453L158.36 65.583L160.202 68.8238ZM162.545 65.583H165.824V68.8238H162.545V65.583Z"
|
||||
fill="white"/>
|
||||
<path d="M99.513 173.072C98.915 173.124 98.278 173.176 97.602 173.228V172.201H99.63V171.434H97.602V170.576H96.744V171.434H95.236C95.561 171.005 95.873 170.511 96.159 169.965H99.721V169.133H96.549C96.653 168.899 96.744 168.665 96.835 168.431L95.899 168.275C95.795 168.561 95.678 168.847 95.561 169.133H93.754V169.965H95.145C94.833 170.55 94.482 171.044 94.118 171.46L94.326 172.201H96.744V173.28C95.86 173.332 94.911 173.371 93.923 173.423L94.04 174.255C94.976 174.203 95.886 174.138 96.744 174.086V175.022H97.602V174.021C98.265 173.956 98.902 173.891 99.513 173.839V173.072ZM101.333 172.214H103.023V175.035H103.92V172.214H105.298V171.395H101.398V170.043C102.802 169.887 103.972 169.588 104.934 169.172L104.336 168.47C103.426 168.886 102.152 169.172 100.54 169.328V171.369C100.514 172.539 100.202 173.54 99.63 174.385L100.28 175.061C100.839 174.255 101.19 173.306 101.333 172.214ZM103.842 175.412H95.314V180.3H96.276V179.793H102.88V180.3H103.842V175.412ZM96.276 178.987V177.973H102.88V178.987H96.276ZM96.276 177.219V176.205H102.88V177.219H96.276ZM107.729 169.081V169.991H111.46V170.862C111.447 171.668 111.395 172.435 111.291 173.137H106.858V174.034H111.135C110.966 174.853 110.732 175.594 110.42 176.244C109.718 177.57 108.483 178.623 106.689 179.429L107.209 180.261C109.016 179.481 110.316 178.376 111.122 176.972C111.564 176.14 111.889 175.165 112.097 174.034H113.15V178.766C113.15 179.65 113.566 180.092 114.424 180.092H116.53C117.076 180.092 117.466 179.975 117.713 179.741C117.999 179.455 118.194 178.688 118.298 177.414L117.414 177.128C117.349 178.142 117.232 178.74 117.05 178.948C116.907 179.117 116.673 179.208 116.361 179.208H114.71C114.294 179.208 114.086 178.987 114.086 178.571V174.034H118.116V173.137H112.24C112.331 172.435 112.383 171.668 112.409 170.862V169.991H117.063V169.081H107.729ZM127.554 171.265H129.478C129.426 173.02 129.153 174.554 128.646 175.867C128.126 174.775 127.71 173.462 127.385 171.941L127.554 171.265ZM128.217 176.803C127.619 177.908 126.826 178.805 125.812 179.507L126.293 180.287C127.268 179.585 128.074 178.714 128.698 177.674C129.348 178.766 130.128 179.65 131.038 180.3L131.545 179.533C130.609 178.896 129.816 177.999 129.14 176.829C129.868 175.295 130.271 173.436 130.336 171.265H131.181V170.368H127.749C127.853 169.796 127.957 169.172 128.035 168.509L127.125 168.353C126.865 170.823 126.345 172.786 125.578 174.242L126.163 174.957C126.436 174.489 126.696 173.956 126.93 173.358C127.281 174.658 127.71 175.802 128.217 176.803ZM122.055 174.424C121.964 174.684 121.86 174.957 121.743 175.243H119.845V176.062H121.379C121.119 176.582 120.82 177.115 120.482 177.687C121.119 177.921 121.717 178.168 122.289 178.415C121.535 178.844 120.612 179.195 119.546 179.481L119.988 180.261C121.288 179.897 122.367 179.416 123.225 178.818C123.992 179.156 124.655 179.507 125.227 179.845L125.734 179.117C125.162 178.805 124.564 178.519 123.94 178.233C124.616 177.609 125.097 176.868 125.383 176.01V175.243H122.666C122.744 175.009 122.835 174.775 122.926 174.528L122.055 174.424ZM123.082 177.869C122.614 177.674 122.12 177.492 121.6 177.31C121.86 176.92 122.094 176.504 122.302 176.062H124.538C124.226 176.738 123.732 177.349 123.082 177.869ZM120.872 168.626L120.131 168.873C120.443 169.367 120.729 169.926 121.002 170.563L121.678 170.251C121.444 169.679 121.184 169.133 120.872 168.626ZM124.824 168.587C124.59 169.133 124.252 169.679 123.836 170.238L124.499 170.576C124.915 170.03 125.24 169.471 125.5 168.899L124.824 168.587ZM119.871 170.875V171.694H121.717C121.327 172.409 120.625 173.059 119.624 173.644L120.079 174.398C121.197 173.644 121.977 172.76 122.406 171.733V174.203H123.277V172.513C123.745 172.825 124.304 173.241 124.954 173.761L125.435 173.033C124.707 172.591 123.979 172.188 123.277 171.837V171.694H125.643V170.875H123.277V168.392H122.406V170.875H119.871ZM134.132 180.183C134.86 180.183 135.224 179.793 135.224 179.039V175.243C135.627 175.061 136.03 174.879 136.433 174.671V173.748C136.043 173.956 135.64 174.151 135.224 174.333V171.772H136.472V170.875H135.224V168.418H134.314V170.875H132.754V171.772H134.314V174.71C133.742 174.918 133.144 175.1 132.546 175.243L132.78 176.153C133.287 175.997 133.794 175.815 134.314 175.62V178.805C134.314 179.169 134.145 179.364 133.82 179.364C133.508 179.364 133.17 179.338 132.832 179.299L133.027 180.183H134.132ZM138.019 174.437H140.671V176.036H138.5V180.3H139.371V179.663H142.894V180.3H143.765V176.036H141.581V174.437H144.363V173.592H141.581V172.058H144.025V168.899H137.174V172.968C137.161 175.698 136.693 177.934 135.77 179.65L136.498 180.3C137.356 178.61 137.863 176.66 138.019 174.437ZM140.671 172.058V173.592H138.071C138.071 173.384 138.084 173.176 138.084 172.968V172.058H140.671ZM139.371 178.831V176.868H142.894V178.831H139.371ZM143.115 169.77V171.213H138.084V169.77H143.115Z"
|
||||
fill="#BFBFBF"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 8.6 KiB |
17
nervui-work-order/src/main.ts
Normal file
17
nervui-work-order/src/main.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
/** @format */
|
||||
|
||||
import { createApp } from 'vue';
|
||||
import App from '/@/App.vue';
|
||||
import { paasInit } from '/nerv-lib/paas';
|
||||
import { apiModule } from '/@/api';
|
||||
import { appConfig } from '/@/config';
|
||||
import '/@/theme/theme.less';
|
||||
|
||||
const app = createApp(App);
|
||||
paasInit({
|
||||
app,
|
||||
apiModule,
|
||||
appConfig,
|
||||
});
|
||||
|
||||
app.mount('#app');
|
||||
@@ -0,0 +1,35 @@
|
||||
echo "=====================================================create====================================================="
|
||||
|
||||
#!/usr/bin/env bash
|
||||
|
||||
function create() {
|
||||
|
||||
if [ -d "$nervui_app_home" ];then
|
||||
echo "$nervui_app_home exists!"
|
||||
else
|
||||
echo "start mkdir $nervui_app_home"
|
||||
mkdir -p "$nervui_app_home"
|
||||
fi
|
||||
|
||||
pkg_file_name=${pkg_url##*/}
|
||||
pkg_file_path="$nervui_app_home$pkg_file_name"
|
||||
|
||||
|
||||
echo "start download $pkg_url"
|
||||
curl -L -o $pkg_file_path $pkg_url
|
||||
|
||||
|
||||
echo "start install $pkg_file_path"
|
||||
tar -xf $pkg_file_path -C $nervui_app_home
|
||||
|
||||
}
|
||||
|
||||
if [ "$pkg_url" == "" ]; then
|
||||
echo {\"error\":\"pkg_url is empty\"}
|
||||
exit 1
|
||||
elif [ "$nervui_app_home" == "" ]; then
|
||||
echo {\"error\":\"nervui_app_home is empty\"}
|
||||
exit 1
|
||||
else
|
||||
create
|
||||
fi
|
||||
@@ -0,0 +1 @@
|
||||
echo "=====================================================delete====================================================="
|
||||
@@ -0,0 +1 @@
|
||||
echo "=====================================================setup====================================================="
|
||||
@@ -0,0 +1 @@
|
||||
echo "=====================================================start====================================================="
|
||||
@@ -0,0 +1 @@
|
||||
echo "=====================================================stop====================================================="
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "/nervui/nervui-work-order",
|
||||
"operations": [
|
||||
{
|
||||
"name": "Create",
|
||||
"type": "shell",
|
||||
"implementor": "create.sh"
|
||||
},
|
||||
{
|
||||
"name": "Delete",
|
||||
"type": "shell",
|
||||
"implementor": "delete.sh"
|
||||
},
|
||||
{
|
||||
"name": "Setup",
|
||||
"type": "shell",
|
||||
"implementor": "setup.sh"
|
||||
},
|
||||
{
|
||||
"name": "Start",
|
||||
"type": "shell",
|
||||
"implementor": "start.sh"
|
||||
},
|
||||
{
|
||||
"name": "Stop",
|
||||
"type": "shell",
|
||||
"implementor": "stop.sh"
|
||||
}
|
||||
]
|
||||
}
|
||||
64
nervui-work-order/src/resources/templates/deploy.json
Normal file
64
nervui-work-order/src/resources/templates/deploy.json
Normal file
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"name": "/nervui/nervui-work-order",
|
||||
"version": 1,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "server_ip",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "应用安装IP地址",
|
||||
"inputType": "ipSelectType"
|
||||
},
|
||||
{
|
||||
"name": "version",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "软件版本",
|
||||
"inputType": "versionSelectType"
|
||||
},
|
||||
{
|
||||
"name": "install_dir",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"defaultValue": "/data",
|
||||
"inputType": "textInputType",
|
||||
"description": "安装目录"
|
||||
}
|
||||
],
|
||||
"nodes": [
|
||||
{
|
||||
"name": "nervui-work-order",
|
||||
"type": "/nerv/nerv-orchestrator/cluster/Nervui",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "file_repository",
|
||||
"value": "${nerv_file_repository}"
|
||||
},
|
||||
{
|
||||
"name": "install_dir",
|
||||
"value": "${install_dir}"
|
||||
},
|
||||
{
|
||||
"name": "pkg_url",
|
||||
"value": "/api/pkg/nerv/nervui-work-order/${version}/nervui-work-order-${version}.tgz"
|
||||
}
|
||||
],
|
||||
"dependencies": [
|
||||
{
|
||||
"type": "contained",
|
||||
"target": "host"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "host",
|
||||
"type": "/nerv/nerv-orchestrator/compute/Host",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "address",
|
||||
"value": "${server_ip}"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
55
nervui-work-order/src/router/index.ts
Normal file
55
nervui-work-order/src/router/index.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import { taskAdd, taskDetail, taskEdit } from '../view/task/config';
|
||||
import { http } from '/nerv-lib/paas';
|
||||
|
||||
const SideNav = () => import('/nerv-lib/paas/view/service/side-nav.vue');
|
||||
const addForm = () => import('/nerv-lib/paas/view/service/add-form.vue');
|
||||
const editForm = () => import('/nerv-lib/paas/view/service/edit-form.vue');
|
||||
const detail = () => import('/nerv-lib/paas/view/service/detail.vue');
|
||||
|
||||
const order = {
|
||||
path: '/work-order',
|
||||
name: 'work-order',
|
||||
component: SideNav,
|
||||
redirect: '/work-order/task',
|
||||
meta: {
|
||||
sideMenus: {
|
||||
title: '工单管理后台',
|
||||
name: 'work-order',
|
||||
root: true,
|
||||
menus: [
|
||||
{
|
||||
name: 'task',
|
||||
label: '工单管理',
|
||||
url: 'work-order',
|
||||
module: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'task',
|
||||
name: 'task',
|
||||
component: () => import('/@/view/task/index.vue'),
|
||||
},
|
||||
{
|
||||
path: 'add',
|
||||
name: 'taskAdd',
|
||||
component: addForm,
|
||||
props: taskAdd,
|
||||
},
|
||||
{
|
||||
path: 'edit',
|
||||
name: 'taskEdit',
|
||||
component: editForm,
|
||||
props: taskEdit,
|
||||
},
|
||||
{
|
||||
path: 'detail',
|
||||
name: 'taskDetail',
|
||||
component: detail,
|
||||
props: taskDetail,
|
||||
},
|
||||
],
|
||||
};
|
||||
export default order;
|
||||
10
nervui-work-order/src/router/redirect.ts
Normal file
10
nervui-work-order/src/router/redirect.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
/** @format */
|
||||
const RootRoute = {
|
||||
path: '/root',
|
||||
name: 'root',
|
||||
redirect: '/work-order/task',
|
||||
meta: {
|
||||
title: 'Root',
|
||||
},
|
||||
};
|
||||
export default RootRoute;
|
||||
30
nervui-work-order/src/store/imageManage.ts
Normal file
30
nervui-work-order/src/store/imageManage.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { defineStore } from 'pinia';
|
||||
|
||||
interface ImageType {
|
||||
isStopUpload: boolean;
|
||||
isUploading: boolean;
|
||||
cancelAxiosFn: Function;
|
||||
}
|
||||
|
||||
const useImageManageStore = defineStore('imageManage', {
|
||||
state: (): ImageType => {
|
||||
return {
|
||||
isStopUpload: false, //是否终止上传
|
||||
isUploading: false,
|
||||
cancelAxiosFn: (): void => {},
|
||||
};
|
||||
},
|
||||
actions: {
|
||||
dispatchStopUpload(is: boolean) {
|
||||
this.isStopUpload = is;
|
||||
},
|
||||
dispatchMonitorUpload(is: boolean) {
|
||||
this.isUploading = is;
|
||||
},
|
||||
dispatchCancelUploadAxios(fn: Function) {
|
||||
this.cancelAxiosFn = fn;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export default useImageManageStore;
|
||||
27
nervui-work-order/src/theme/global.less
Normal file
27
nervui-work-order/src/theme/global.less
Normal file
@@ -0,0 +1,27 @@
|
||||
#app {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.content {
|
||||
min-height: 100% !important;
|
||||
}
|
||||
}
|
||||
.vm-app {
|
||||
height: 100%;
|
||||
}
|
||||
.web-console-page {
|
||||
.headerMenu,
|
||||
.leftMenu {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.ns-table-no-search {
|
||||
.ns-table-header {
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
padding-top: 0 !important;
|
||||
height: 46px !important;
|
||||
}
|
||||
}
|
||||
.ns-table-search {
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
2
nervui-work-order/src/theme/theme.less
Normal file
2
nervui-work-order/src/theme/theme.less
Normal file
@@ -0,0 +1,2 @@
|
||||
@import "variable";
|
||||
@import "global";
|
||||
0
nervui-work-order/src/theme/variable.less
Normal file
0
nervui-work-order/src/theme/variable.less
Normal file
325
nervui-work-order/src/view/task/config.ts
Normal file
325
nervui-work-order/src/view/task/config.ts
Normal file
@@ -0,0 +1,325 @@
|
||||
import { API } from '/@/api';
|
||||
import { dateUtil, http } from '/nerv-lib/util';
|
||||
|
||||
export const taskAdd = {
|
||||
title: '新增',
|
||||
api: API.taskAdd,
|
||||
formLayout: 'vertical',
|
||||
schemas: [
|
||||
{
|
||||
label: '姓名',
|
||||
field: 'name',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入',
|
||||
},
|
||||
rules: [{ required: true, message: '不能为空' }],
|
||||
},
|
||||
{
|
||||
label: '手机号',
|
||||
field: 'phone',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入',
|
||||
},
|
||||
rules: [
|
||||
{ required: true, message: '不能为空' },
|
||||
{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '邮箱',
|
||||
field: 'email',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入',
|
||||
},
|
||||
rules: [
|
||||
{ required: true, message: '不能为空' },
|
||||
{
|
||||
pattern: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
|
||||
message: '请输入正确的邮箱',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '公司',
|
||||
field: 'company',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入',
|
||||
},
|
||||
rules: [{ required: true, message: '不能为空' }],
|
||||
},
|
||||
{
|
||||
label: '省份',
|
||||
field: 'province',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入',
|
||||
},
|
||||
rules: [{ required: true, message: '不能为空' }],
|
||||
},
|
||||
{
|
||||
label: '行业',
|
||||
field: 'industry',
|
||||
component: 'NsSelectApi',
|
||||
componentProps: {
|
||||
api: API.industry,
|
||||
resultField: 'data',
|
||||
immediate: true,
|
||||
placeholder: '请选择',
|
||||
},
|
||||
rules: [{ required: true, message: '不能为空' }],
|
||||
},
|
||||
{
|
||||
label: '职务',
|
||||
field: 'job',
|
||||
component: 'NsSelectApi',
|
||||
componentProps: {
|
||||
placeholder: '请选择',
|
||||
api: API.job,
|
||||
resultField: 'data',
|
||||
immediate: true,
|
||||
},
|
||||
rules: [{ required: true, message: '不能为空' }],
|
||||
},
|
||||
{
|
||||
label: '需求',
|
||||
field: 'requirement',
|
||||
component: 'NsTextarea',
|
||||
componentProps: {
|
||||
placeholder: '请输入',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '对接人员',
|
||||
field: 'dingTalkUserId',
|
||||
component: 'NsSelectApi',
|
||||
componentProps: {
|
||||
placeholder: '请选择',
|
||||
api: API.employee,
|
||||
resultField: 'data',
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
immediate: true,
|
||||
},
|
||||
rules: [{ required: true, message: '不能为空' }],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const taskEdit = {
|
||||
title: '编辑',
|
||||
api: API.taskEdit,
|
||||
getApi: (params) => {
|
||||
return http.get(API.tastDetail, params).then((res) => res.data);
|
||||
},
|
||||
formLayout: 'vertical',
|
||||
schemas: [
|
||||
{
|
||||
label: 'id',
|
||||
field: 'id',
|
||||
},
|
||||
{
|
||||
label: '姓名',
|
||||
field: 'name',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入',
|
||||
},
|
||||
rules: [{ required: true, message: '不能为空' }],
|
||||
},
|
||||
{
|
||||
label: '手机号',
|
||||
field: 'phone',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入',
|
||||
},
|
||||
rules: [
|
||||
{ required: true, message: '不能为空' },
|
||||
{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '邮箱',
|
||||
field: 'email',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入',
|
||||
},
|
||||
rules: [
|
||||
{ required: true, message: '不能为空' },
|
||||
{
|
||||
pattern: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
|
||||
message: '请输入正确的邮箱',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '公司',
|
||||
field: 'company',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入',
|
||||
},
|
||||
rules: [{ required: true, message: '不能为空' }],
|
||||
},
|
||||
{
|
||||
label: '省份',
|
||||
field: 'province',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入',
|
||||
},
|
||||
rules: [{ required: true, message: '不能为空' }],
|
||||
},
|
||||
{
|
||||
label: '行业',
|
||||
field: 'industry',
|
||||
component: 'NsSelectApi',
|
||||
componentProps: {
|
||||
api: API.industry,
|
||||
resultField: 'data',
|
||||
immediate: true,
|
||||
placeholder: '请选择',
|
||||
},
|
||||
rules: [{ required: true, message: '不能为空' }],
|
||||
},
|
||||
{
|
||||
label: '职务',
|
||||
field: 'job',
|
||||
component: 'NsSelectApi',
|
||||
componentProps: {
|
||||
placeholder: '请选择',
|
||||
api: API.job,
|
||||
resultField: 'data',
|
||||
immediate: true,
|
||||
},
|
||||
rules: [{ required: true, message: '不能为空' }],
|
||||
},
|
||||
{
|
||||
label: '需求',
|
||||
field: 'requirement',
|
||||
component: 'NsTextarea',
|
||||
componentProps: {
|
||||
placeholder: '请输入',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '对接人员',
|
||||
field: 'dingTalkUserId',
|
||||
component: 'NsSelectApi',
|
||||
componentProps: {
|
||||
placeholder: '请选择',
|
||||
api: API.employee,
|
||||
resultField: 'data',
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
immediate: true,
|
||||
},
|
||||
rules: [{ required: true, message: '不能为空' }],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const taskDetail = {
|
||||
title: '详情',
|
||||
showBack: true,
|
||||
api: (params) => http.get(API.tastDetail, params),
|
||||
dataHandle: (val) => {
|
||||
return val.data;
|
||||
},
|
||||
detail: [
|
||||
{
|
||||
title: '',
|
||||
items: [
|
||||
{
|
||||
label: '姓名',
|
||||
name: 'name',
|
||||
},
|
||||
{
|
||||
label: '手机号',
|
||||
name: 'phone',
|
||||
},
|
||||
{
|
||||
label: '邮箱',
|
||||
name: 'email',
|
||||
},
|
||||
{
|
||||
label: '公司',
|
||||
name: 'company',
|
||||
},
|
||||
{
|
||||
label: '省份',
|
||||
name: 'province',
|
||||
},
|
||||
{
|
||||
label: '行业',
|
||||
name: 'industry',
|
||||
},
|
||||
{
|
||||
label: '职务',
|
||||
name: 'job',
|
||||
},
|
||||
{
|
||||
label: '需求',
|
||||
name: 'requirement',
|
||||
},
|
||||
{
|
||||
label: '对接人员',
|
||||
name: 'dingTalkUser',
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
name: 'status',
|
||||
},
|
||||
{
|
||||
label: '关闭理由',
|
||||
name: 'reason',
|
||||
ifShow: ({ status }) => status === '已关闭',
|
||||
},
|
||||
// {
|
||||
// label: '创建时间',
|
||||
// name: 'created_at',
|
||||
// format: (value) => {
|
||||
// return dateUtil(value).format('YYYY-MM-DD HH:mm:ss');
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// label: '修改时间',
|
||||
// name: 'updated_at',
|
||||
// format: (value) => {
|
||||
// return dateUtil(value).format('YYYY-MM-DD HH:mm:ss');
|
||||
// },
|
||||
// },
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const taskClose = {
|
||||
title: '关闭工单',
|
||||
api: { url: API.close, method: 'put' },
|
||||
formLayout: 'vertical',
|
||||
schemas: [
|
||||
{
|
||||
label: '关闭理由',
|
||||
field: 'id',
|
||||
show: false,
|
||||
component: 'NsTextarea',
|
||||
},
|
||||
{
|
||||
label: '关闭理由',
|
||||
field: 'reason',
|
||||
component: 'NsTextarea',
|
||||
componentProps: {
|
||||
placeholder: '请输入',
|
||||
},
|
||||
rules: [{ required: true, message: '不能为空' }],
|
||||
},
|
||||
],
|
||||
};
|
||||
121
nervui-work-order/src/view/task/index.vue
Normal file
121
nervui-work-order/src/view/task/index.vue
Normal file
@@ -0,0 +1,121 @@
|
||||
<!-- @format -->
|
||||
|
||||
<template>
|
||||
<modalForm ref="modalFormRef" />
|
||||
<ns-view-list-table v-bind="tableConfig" ref="nsTableRef" />
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, computed, unref } from 'vue';
|
||||
import { dateUtil } from '/nerv-lib/util/date-util';
|
||||
import { useRouter } from 'vue-router';
|
||||
import modalForm from '/@/components/ns-modal-form.vue';
|
||||
import { taskClose } from './config';
|
||||
import { API } from '/@/api';
|
||||
import { http } from '/nerv-lib/util';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'TaskList',
|
||||
components: { modalForm },
|
||||
setup() {
|
||||
const router = useRouter();
|
||||
const nsTableRef = ref();
|
||||
const modalFormRef = ref();
|
||||
const tableConfig = {
|
||||
api: '/api/work/objs/consult/list',
|
||||
title: '工单管理',
|
||||
rowSelection: null,
|
||||
resultField: 'data',
|
||||
columns: [
|
||||
{
|
||||
title: '单号',
|
||||
dataIndex: 'id',
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
dataIndex: 'phone',
|
||||
},
|
||||
{
|
||||
title: '邮箱',
|
||||
dataIndex: 'email',
|
||||
},
|
||||
{
|
||||
title: '公司',
|
||||
dataIndex: 'company',
|
||||
},
|
||||
{
|
||||
title: '对接钉钉人员',
|
||||
dataIndex: 'dingTalkUser',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
},
|
||||
{
|
||||
title: '提交时间',
|
||||
dataIndex: 'createTime',
|
||||
customRender: ({ value }: any) => {
|
||||
return value ? dateUtil(value).format('YYYY-MM-DD HH:mm:ss') : '-';
|
||||
},
|
||||
},
|
||||
],
|
||||
columnActions: {
|
||||
fixed: 'right',
|
||||
title: '操作',
|
||||
actions: [
|
||||
{
|
||||
label: '删除',
|
||||
name: 'remove',
|
||||
confirm: true,
|
||||
isReload: true,
|
||||
dynamicParams: 'id',
|
||||
api: (params) => http.delete(`${API.tastDelete}?id=${params.id}`),
|
||||
},
|
||||
{
|
||||
label: '编辑',
|
||||
name: 'edit',
|
||||
route: 'edit',
|
||||
dynamicParams: 'id',
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
name: 'detail',
|
||||
dynamicParams: 'id',
|
||||
route: 'detail',
|
||||
},
|
||||
{
|
||||
label: '关闭',
|
||||
name: 'close',
|
||||
ifShow: ({ status }) => status !== '已关闭',
|
||||
handle: (record, name, el) =>
|
||||
modalFormRef.value?.acceptFormConfig(taskClose, el, record),
|
||||
},
|
||||
],
|
||||
},
|
||||
headerActions: [
|
||||
{
|
||||
label: '添加',
|
||||
name: 'add',
|
||||
type: 'primary',
|
||||
route: 'add',
|
||||
},
|
||||
],
|
||||
formConfig: {},
|
||||
|
||||
rowKey: 'ID',
|
||||
};
|
||||
return {
|
||||
nsTableRef,
|
||||
dateUtil,
|
||||
tableConfig,
|
||||
modalFormRef,
|
||||
};
|
||||
},
|
||||
methods: {},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
53
nervui-work-order/tsconfig.json
Normal file
53
nervui-work-order/tsconfig.json
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"baseUrl": "./",
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"jsx": "preserve",
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom"
|
||||
],
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"resolveJsonModule": true,
|
||||
"skipLibCheck": true,
|
||||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"strictFunctionTypes": false,
|
||||
"target": "esnext",
|
||||
"types": [
|
||||
"vite/client"
|
||||
],
|
||||
"typeRoots": [
|
||||
"../node_modules/@types",
|
||||
"../node_modules/@vue",
|
||||
"../type"
|
||||
],
|
||||
"paths": {
|
||||
"/@/*": [
|
||||
"src/*"
|
||||
],
|
||||
"/nerv-lib/*": [
|
||||
"../lib/*"
|
||||
],
|
||||
"/nerv-base/*": [
|
||||
"../lib/paas/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"src/**/*",
|
||||
"type/**/*",
|
||||
"mock/**/*",
|
||||
"vite.config.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist",
|
||||
"**/*.js"
|
||||
]
|
||||
}
|
||||
17
nervui-work-order/vite.config.ts
Normal file
17
nervui-work-order/vite.config.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
/** @format */
|
||||
|
||||
import configFun from '../build/vite-default.config';
|
||||
|
||||
const dirname = __dirname;
|
||||
const proxy = {
|
||||
'/api/work': {
|
||||
target: 'http://100.86.226.6:8092',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api\/work/, '/api'),
|
||||
},
|
||||
|
||||
'/api': { target: 'http://portal.op.sh.dingcloud.com:30080/', changeOrigin: true },
|
||||
|
||||
'/asset': { target: 'http://portal.op.dingcloud.com:30080/', changeOrigin: true },
|
||||
};
|
||||
export default configFun({ dirname, serviceMode: 'paas', baseDir: '../', proxy });
|
||||
Reference in New Issue
Block a user