组件流程开发
This commit is contained in:
@@ -2,3 +2,5 @@
|
|||||||
shamefully-hoist=true
|
shamefully-hoist=true
|
||||||
auto-install-peers=true
|
auto-install-peers=true
|
||||||
strict-peer-dependencies=false
|
strict-peer-dependencies=false
|
||||||
|
@qomo:registry=https://packages.aliyun.com/669a1b3bbedb1acc325c96c0/npm/npm-registry/
|
||||||
|
@qomo-platform:registry=https://packages.aliyun.com/669a1b3bbedb1acc325c96c0/npm/npm-registry/
|
||||||
|
|||||||
+2
-1
@@ -16,7 +16,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@element-plus/icons-vue": "2.3.1",
|
"@element-plus/icons-vue": "2.3.1",
|
||||||
"@qomo-platform/core": "^1.0.100",
|
"@qomo-platform/core": "^1.0.151",
|
||||||
"@vueup/vue-quill": "1.2.0",
|
"@vueup/vue-quill": "1.2.0",
|
||||||
"@vueuse/core": "10.6.1",
|
"@vueuse/core": "10.6.1",
|
||||||
"axios": "1.6.7",
|
"axios": "1.6.7",
|
||||||
@@ -33,6 +33,7 @@
|
|||||||
"pinia-plugin-persistedstate": "^3.2.1",
|
"pinia-plugin-persistedstate": "^3.2.1",
|
||||||
"postcss-pxtorem": "^6.1.0",
|
"postcss-pxtorem": "^6.1.0",
|
||||||
"prettier": "^3.2.5",
|
"prettier": "^3.2.5",
|
||||||
|
"uuid": "^10.0.0",
|
||||||
"vite-plugin-qiankun": "^1.0.15",
|
"vite-plugin-qiankun": "^1.0.15",
|
||||||
"vue": "3.3.9",
|
"vue": "3.3.9",
|
||||||
"vue-router": "4.2.5"
|
"vue-router": "4.2.5"
|
||||||
|
|||||||
+49
-1
@@ -1,3 +1,51 @@
|
|||||||
|
import request from "@/service/request";
|
||||||
export function getDictCode(params) {
|
export function getDictCode(params) {
|
||||||
return request.get(`/sys/dictItem/type`,params);
|
return request.get(`/sys/dictItem/type`, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
//保存流程图
|
||||||
|
export function saveFlowModel(data) {
|
||||||
|
return request.post("/api/flowDefinition/saveModel", {}, data, {
|
||||||
|
message: {
|
||||||
|
success: `保存成功`,
|
||||||
|
error: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//执行流程
|
||||||
|
export function flowInstanceExecute(id) {
|
||||||
|
return request.post(`/api/dataIntegration/flowInstance/execute/${id}`, {}, {}, {
|
||||||
|
message: {
|
||||||
|
success: `流程开始运行`,
|
||||||
|
error: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//查询数据源
|
||||||
|
export function dataSourceList(params) {
|
||||||
|
return request.get("/api/group/treeList", params, {
|
||||||
|
error: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//查询组件
|
||||||
|
export function getComponentTree(params) {
|
||||||
|
return request.get("/api/componentGroup/getComponentTree", params, {
|
||||||
|
error: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//查询数据库列表
|
||||||
|
export function databaseListSchemas(params) {
|
||||||
|
return request.get('/api/database/listSchemas', params, {
|
||||||
|
error: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询表
|
||||||
|
export function listTablesBySchemaPage(params) {
|
||||||
|
return request.get('/api/database/listTablesBySchemaPage', params);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取表字段
|
||||||
|
export function listColumns(params) {
|
||||||
|
return request.get('/api/database/listColumns', params);
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
import request from "@/service/request";
|
||||||
|
/*获取模型列表*/
|
||||||
|
export function modelList(params) {
|
||||||
|
return request.get(`/cost-model/pageList`, params);
|
||||||
|
}
|
||||||
|
// /*新增小时费率*/
|
||||||
|
// export function addHourRate(data) {
|
||||||
|
// return request.post("/hourRate/add", {}, data, {
|
||||||
|
// message: {
|
||||||
|
// success: "新增成功",
|
||||||
|
// error: true
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// /*编辑小时费率*/
|
||||||
|
// export function editHourRate(data) {
|
||||||
|
// return request.post("/hourRate/edit", {}, data, {
|
||||||
|
// message: {
|
||||||
|
// success: "编辑成功",
|
||||||
|
// error: true
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
/*删除*/
|
||||||
|
export function deleteModel(data) {
|
||||||
|
return request.post("/cost-model/delete",{}, data,{
|
||||||
|
message: {
|
||||||
|
success: "删除成功",
|
||||||
|
error: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 493 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 588 B |
Binary file not shown.
|
After Width: | Height: | Size: 868 B |
Binary file not shown.
|
After Width: | Height: | Size: 720 B |
Binary file not shown.
|
After Width: | Height: | Size: 539 B |
@@ -0,0 +1,245 @@
|
|||||||
|
<script lang="tsx">
|
||||||
|
import {
|
||||||
|
computed,
|
||||||
|
defineComponent,
|
||||||
|
ref,
|
||||||
|
onMounted,
|
||||||
|
watchEffect,
|
||||||
|
watch
|
||||||
|
} from "vue";
|
||||||
|
import { useExposeDialogArgs } from "@qomo-platform/core";
|
||||||
|
import { useRequest } from "vue-request";
|
||||||
|
import {
|
||||||
|
dataSourceList,
|
||||||
|
databaseListSchemas,
|
||||||
|
listTablesBySchemaPage,
|
||||||
|
listColumns
|
||||||
|
} from "@/api";
|
||||||
|
import icon_report from "@/assets/imgs/icon_report.png";
|
||||||
|
import icon_folder from "@/assets/imgs/icon_folder.png";
|
||||||
|
import dateIcon from "@/assets/imgs/dateIcon.png";
|
||||||
|
import numberIcon from "@/assets/imgs/numberIcon.png";
|
||||||
|
import stringIcon from "@/assets/imgs/stringIcon.png";
|
||||||
|
import databaseIcon from "@/assets/imgs/database.png";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
import { da } from "element-plus/es/locale";
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: "SqlStatement",
|
||||||
|
props: {
|
||||||
|
model: {
|
||||||
|
type: Object
|
||||||
|
},
|
||||||
|
},
|
||||||
|
setup(props, { attrs, expose, slots = {} }) {
|
||||||
|
const typeNumber = [
|
||||||
|
"int",
|
||||||
|
"smallint",
|
||||||
|
"bigint",
|
||||||
|
"float",
|
||||||
|
"double",
|
||||||
|
"decimal",
|
||||||
|
"bit"
|
||||||
|
],
|
||||||
|
typeDate = ["date", "datetime", "time", "timestamp"],
|
||||||
|
typeString = ["char", "varchar", "varchar2", "text"];
|
||||||
|
const { data, error } = useRequest(async () => await dataSourceList());
|
||||||
|
|
||||||
|
const {
|
||||||
|
run,
|
||||||
|
data: _schemaData_,
|
||||||
|
loading
|
||||||
|
} = useRequest(databaseListSchemas, {
|
||||||
|
manual: true
|
||||||
|
});
|
||||||
|
|
||||||
|
const {
|
||||||
|
run: listTablesBySchemaPageRun,
|
||||||
|
data: tablesData,
|
||||||
|
loading: listTablesLoading
|
||||||
|
} = useRequest(listTablesBySchemaPage, {
|
||||||
|
manual: true
|
||||||
|
});
|
||||||
|
|
||||||
|
const {
|
||||||
|
run: listColumnsRun,
|
||||||
|
data: listColumnsData,
|
||||||
|
loading: listColumnsLoading
|
||||||
|
} = useRequest(listColumns, {
|
||||||
|
manual: true
|
||||||
|
});
|
||||||
|
|
||||||
|
const schemaData = computed(() =>
|
||||||
|
(_schemaData_.value || []).map(item => ({
|
||||||
|
label: item.name,
|
||||||
|
value: item.name
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
|
||||||
|
const handleNodeClick = async node => {
|
||||||
|
if (node.nodeType) {
|
||||||
|
props.model.dataSource = node.name;
|
||||||
|
props.model.url = node.url;
|
||||||
|
props.model.username = node.userName;
|
||||||
|
props.model.password = node.password;
|
||||||
|
props.model.currentNode = node;
|
||||||
|
run({ id: node.id });
|
||||||
|
} else ElMessage.warning("选中的不是数据源,请重新选择");
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.model.schema,
|
||||||
|
val => {
|
||||||
|
if (val)
|
||||||
|
listTablesBySchemaPageRun({
|
||||||
|
id: props.model.currentNode.id,
|
||||||
|
schemaName: props.model.schema,
|
||||||
|
tableName: "",
|
||||||
|
typeList: "table,view",
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 1000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
const filterNodeMethod = (value, data) => data.name.includes(value);
|
||||||
|
|
||||||
|
const loadNode = async (node, resolve) => {
|
||||||
|
const { data } = node;
|
||||||
|
if (node?.level !== 0) {
|
||||||
|
await listColumnsRun({
|
||||||
|
id: props.model.currentNode.id,
|
||||||
|
tableName: data.name,
|
||||||
|
schemaName: props.model.schema
|
||||||
|
});
|
||||||
|
resolve(listColumnsData.value);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const filterSearch = async value => {
|
||||||
|
listTablesBySchemaPageRun({
|
||||||
|
id: props.model.currentNode.id,
|
||||||
|
schemaName: props.model.schema,
|
||||||
|
tableName: value,
|
||||||
|
typeList: "table,view",
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 1000
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleTableClick = node => {
|
||||||
|
props.model.sqlString = `select * from ${node.name}`;
|
||||||
|
// this.$refs.codemirrorTic.$refs.mycode.__vue__.focus();
|
||||||
|
};
|
||||||
|
|
||||||
|
return () => (
|
||||||
|
<>
|
||||||
|
<base-form-item label="数据源:" prop="dataSource" span={8}>
|
||||||
|
<el-tree-select
|
||||||
|
v-model={props.model.dataSource}
|
||||||
|
data={data.value}
|
||||||
|
value-key="name"
|
||||||
|
filter-node-method={filterNodeMethod}
|
||||||
|
filterable
|
||||||
|
render-after-expand={false}
|
||||||
|
style="width: 240px"
|
||||||
|
v-slots={{
|
||||||
|
default: ({ data }) => (
|
||||||
|
<div
|
||||||
|
class="flex items-center gap-[5px]"
|
||||||
|
onClick={() => handleNodeClick(data)}
|
||||||
|
>
|
||||||
|
{data.children && !data.parentId && (
|
||||||
|
<img class="w-[15px] h-[15px]" src={icon_report} alt="" />
|
||||||
|
)}
|
||||||
|
{data.children && data.parentId && (
|
||||||
|
<img class="w-[15px] h-[15px]" src={icon_folder} alt="" />
|
||||||
|
)}
|
||||||
|
<span class={"text-[12px] text-[#26314a] font-[400]"}>
|
||||||
|
{data.name}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</base-form-item>
|
||||||
|
<base-form-item label="schema:" prop="schema" span={8}>
|
||||||
|
<base-select
|
||||||
|
disabled={loading.value}
|
||||||
|
placeholder={loading.value ? "加载中" : "请选择"}
|
||||||
|
v-model={props.model.schema}
|
||||||
|
options={schemaData.value}
|
||||||
|
></base-select>
|
||||||
|
</base-form-item>
|
||||||
|
<div
|
||||||
|
class={
|
||||||
|
"max-h-[400px] overflow-auto border-solid border-[1px] border-[#ccc] p-[10px]"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<base-tree
|
||||||
|
data={tablesData.value?.records}
|
||||||
|
filterables={{
|
||||||
|
size: "small"
|
||||||
|
}}
|
||||||
|
props={{
|
||||||
|
label: "name"
|
||||||
|
}}
|
||||||
|
load={loadNode}
|
||||||
|
filterSearch={filterSearch}
|
||||||
|
lazy
|
||||||
|
v-slots={{
|
||||||
|
default: ({ node, data }) => {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
onClick={() => handleTableClick(data)}
|
||||||
|
class={"flex items-center gap-[4px] text-[12px]"}
|
||||||
|
>
|
||||||
|
{node.level === 1 && (
|
||||||
|
<img
|
||||||
|
class="w-[15px] h-[15px]"
|
||||||
|
src={databaseIcon}
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{!data.columns &&
|
||||||
|
typeNumber.includes(
|
||||||
|
(data?.type || "").toLocaleLowerCase()
|
||||||
|
) && (
|
||||||
|
<img
|
||||||
|
class="w-[15px] h-[15px]"
|
||||||
|
src={numberIcon}
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{!data.columns &&
|
||||||
|
typeDate.includes(
|
||||||
|
(data?.type || "").toLocaleLowerCase()
|
||||||
|
) && (
|
||||||
|
<img class="w-[15px] h-[15px]" src={dateIcon} alt="" />
|
||||||
|
)}
|
||||||
|
{!data.columns &&
|
||||||
|
typeString.includes(
|
||||||
|
(data?.type || "").toLocaleLowerCase()
|
||||||
|
) && (
|
||||||
|
<img
|
||||||
|
class="w-[15px] h-[15px]"
|
||||||
|
src={stringIcon}
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<span class="text-[12px]">
|
||||||
|
{data.name}
|
||||||
|
{data.comment && <span>({data.comment})</span>}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss"></style>
|
||||||
@@ -0,0 +1,273 @@
|
|||||||
|
<script lang="tsx">
|
||||||
|
import {
|
||||||
|
computed,
|
||||||
|
defineComponent,
|
||||||
|
ref,
|
||||||
|
onMounted,
|
||||||
|
watchEffect,
|
||||||
|
watch
|
||||||
|
} from "vue";
|
||||||
|
import { useExposeDialogArgs } from "@qomo-platform/core";
|
||||||
|
import { useRequest } from "vue-request";
|
||||||
|
import {
|
||||||
|
dataSourceList,
|
||||||
|
databaseListSchemas,
|
||||||
|
listTablesBySchemaPage,
|
||||||
|
listColumns
|
||||||
|
} from "@/api";
|
||||||
|
import icon_report from "@/assets/imgs/icon_report.png";
|
||||||
|
import icon_folder from "@/assets/imgs/icon_folder.png";
|
||||||
|
import dateIcon from "@/assets/imgs/dateIcon.png";
|
||||||
|
import numberIcon from "@/assets/imgs/numberIcon.png";
|
||||||
|
import stringIcon from "@/assets/imgs/stringIcon.png";
|
||||||
|
import databaseIcon from "@/assets/imgs/database.png";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
import { da } from "element-plus/es/locale";
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: "SqlStatement",
|
||||||
|
props: {
|
||||||
|
model: {
|
||||||
|
type: Object
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setup(props, { attrs, expose, slots = {} }) {
|
||||||
|
const typeNumber = [
|
||||||
|
"int",
|
||||||
|
"smallint",
|
||||||
|
"bigint",
|
||||||
|
"float",
|
||||||
|
"double",
|
||||||
|
"decimal",
|
||||||
|
"bit"
|
||||||
|
],
|
||||||
|
typeDate = ["date", "datetime", "time", "timestamp"],
|
||||||
|
typeString = ["char", "varchar", "varchar2", "text"];
|
||||||
|
const { data, error } = useRequest(async () => await dataSourceList());
|
||||||
|
|
||||||
|
const {
|
||||||
|
run,
|
||||||
|
data: _schemaData_,
|
||||||
|
loading
|
||||||
|
} = useRequest(databaseListSchemas, {
|
||||||
|
manual: true
|
||||||
|
});
|
||||||
|
|
||||||
|
const {
|
||||||
|
run: listTablesBySchemaPageRun,
|
||||||
|
data: tablesData,
|
||||||
|
loading: listTablesLoading
|
||||||
|
} = useRequest(listTablesBySchemaPage, {
|
||||||
|
manual: true
|
||||||
|
});
|
||||||
|
|
||||||
|
const {
|
||||||
|
run: listColumnsRun,
|
||||||
|
data: listColumnsData,
|
||||||
|
loading: listColumnsLoading
|
||||||
|
} = useRequest(listColumns, {
|
||||||
|
manual: true
|
||||||
|
});
|
||||||
|
|
||||||
|
const schemaData = computed(() =>
|
||||||
|
(_schemaData_.value || []).map(item => ({
|
||||||
|
label: item.name,
|
||||||
|
value: item.name
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
|
||||||
|
const handleNodeClick = async node => {
|
||||||
|
if (node.nodeType) {
|
||||||
|
props.model.dataSource = node.name;
|
||||||
|
props.model.url = node.url;
|
||||||
|
props.model.username = node.userName;
|
||||||
|
props.model.password = node.password;
|
||||||
|
props.model.currentNode = node;
|
||||||
|
run({ id: node.id });
|
||||||
|
} else ElMessage.warning("选中的不是数据源,请重新选择");
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.model.schema,
|
||||||
|
val => {
|
||||||
|
if (val)
|
||||||
|
listTablesBySchemaPageRun({
|
||||||
|
id: props.model.currentNode.id,
|
||||||
|
schemaName: props.model.schema,
|
||||||
|
tableName: "",
|
||||||
|
typeList: "table,view",
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 1000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
const filterNodeMethod = (value, data) => data.name.includes(value);
|
||||||
|
|
||||||
|
const loadNode = async (node, resolve) => {
|
||||||
|
const { data } = node;
|
||||||
|
if (node?.level !== 0) {
|
||||||
|
await listColumnsRun({
|
||||||
|
id: props.model.currentNode.id,
|
||||||
|
tableName: data.name,
|
||||||
|
schemaName: props.model.schema
|
||||||
|
});
|
||||||
|
resolve(listColumnsData.value);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const filterSearch = async value => {
|
||||||
|
listTablesBySchemaPageRun({
|
||||||
|
id: props.model.currentNode.id,
|
||||||
|
schemaName: props.model.schema,
|
||||||
|
tableName: value,
|
||||||
|
typeList: "table,view",
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 1000
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleTableClick = node => {
|
||||||
|
props.model.sqlString = `select * from ${node.name}`;
|
||||||
|
// this.$refs.codemirrorTic.$refs.mycode.__vue__.focus();
|
||||||
|
};
|
||||||
|
const feeTypeList = [
|
||||||
|
{
|
||||||
|
label: "机器折旧费",
|
||||||
|
value: "EquipmentFee"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "辅料费",
|
||||||
|
value: "SupplyMaterialFee"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "水电费",
|
||||||
|
value: "DriverFee"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "其他费用",
|
||||||
|
value: "OtherFee"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "物流费",
|
||||||
|
value: "LogisticsFee"
|
||||||
|
}
|
||||||
|
];
|
||||||
|
return () => (
|
||||||
|
<>
|
||||||
|
<base-form-item label="费用类型:" prop="feeType" span={8}>
|
||||||
|
<base-select
|
||||||
|
placeholder={loading.value ? "加载中" : "请选择"}
|
||||||
|
v-model={props.model.feeType}
|
||||||
|
options={feeTypeList}
|
||||||
|
></base-select>
|
||||||
|
</base-form-item>
|
||||||
|
<base-form-item label="数据源:" prop="dataSource" span={8}>
|
||||||
|
<el-tree-select
|
||||||
|
v-model={props.model.dataSource}
|
||||||
|
data={data.value}
|
||||||
|
value-key="name"
|
||||||
|
filter-node-method={filterNodeMethod}
|
||||||
|
filterable
|
||||||
|
render-after-expand={false}
|
||||||
|
style="width: 240px"
|
||||||
|
v-slots={{
|
||||||
|
default: ({ data }) => (
|
||||||
|
<div
|
||||||
|
class="flex items-center gap-[5px]"
|
||||||
|
onClick={() => handleNodeClick(data)}
|
||||||
|
>
|
||||||
|
{data.children && !data.parentId && (
|
||||||
|
<img class="w-[15px] h-[15px]" src={icon_report} alt="" />
|
||||||
|
)}
|
||||||
|
{data.children && data.parentId && (
|
||||||
|
<img class="w-[15px] h-[15px]" src={icon_folder} alt="" />
|
||||||
|
)}
|
||||||
|
<span class={"text-[12px] text-[#26314a] font-[400]"}>
|
||||||
|
{data.name}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</base-form-item>
|
||||||
|
<base-form-item label="schema:" prop="schema" span={8}>
|
||||||
|
<base-select
|
||||||
|
disabled={loading.value}
|
||||||
|
placeholder={loading.value ? "加载中" : "请选择"}
|
||||||
|
v-model={props.model.schema}
|
||||||
|
options={schemaData.value}
|
||||||
|
></base-select>
|
||||||
|
</base-form-item>
|
||||||
|
<div
|
||||||
|
class={
|
||||||
|
"max-h-[400px] overflow-auto border-solid border-[1px] border-[#ccc] p-[10px]"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<base-tree
|
||||||
|
data={tablesData.value?.records}
|
||||||
|
filterables={{
|
||||||
|
size: "small"
|
||||||
|
}}
|
||||||
|
props={{
|
||||||
|
label: "name"
|
||||||
|
}}
|
||||||
|
load={loadNode}
|
||||||
|
filterSearch={filterSearch}
|
||||||
|
lazy
|
||||||
|
v-slots={{
|
||||||
|
default: ({ node, data }) => {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
onClick={() => handleTableClick(data)}
|
||||||
|
class={"flex items-center gap-[4px] text-[12px]"}
|
||||||
|
>
|
||||||
|
{node.level === 1 && (
|
||||||
|
<img
|
||||||
|
class="w-[15px] h-[15px]"
|
||||||
|
src={databaseIcon}
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{!data.columns &&
|
||||||
|
typeNumber.includes(
|
||||||
|
(data?.type || "").toLocaleLowerCase()
|
||||||
|
) && (
|
||||||
|
<img
|
||||||
|
class="w-[15px] h-[15px]"
|
||||||
|
src={numberIcon}
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{!data.columns &&
|
||||||
|
typeDate.includes(
|
||||||
|
(data?.type || "").toLocaleLowerCase()
|
||||||
|
) && (
|
||||||
|
<img class="w-[15px] h-[15px]" src={dateIcon} alt="" />
|
||||||
|
)}
|
||||||
|
{!data.columns &&
|
||||||
|
typeString.includes(
|
||||||
|
(data?.type || "").toLocaleLowerCase()
|
||||||
|
) && (
|
||||||
|
<img
|
||||||
|
class="w-[15px] h-[15px]"
|
||||||
|
src={stringIcon}
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<span class="text-[12px]">
|
||||||
|
{data.name}
|
||||||
|
{data.comment && <span>({data.comment})</span>}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss"></style>
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
<script lang="tsx">
|
||||||
|
import {
|
||||||
|
computed,
|
||||||
|
defineComponent,
|
||||||
|
ref,
|
||||||
|
onMounted,
|
||||||
|
watchEffect,
|
||||||
|
watch
|
||||||
|
} from "vue";
|
||||||
|
import { useExposeDialogArgs } from "@qomo-platform/core";
|
||||||
|
import SqlStatement from "@/components/SqlStatement";
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: "dbOutput",
|
||||||
|
props: {
|
||||||
|
nodeDetail: {
|
||||||
|
type: Object
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setup(props, { attrs, expose, slots = {} }) {
|
||||||
|
const nodeDetail = computed(() => props?.nodeDetail);
|
||||||
|
const baseFormRef = ref({});
|
||||||
|
const baseMonacoEditorRef = ref();
|
||||||
|
const { findNodesPrev, findNodesNext, getNodeData } = attrs;
|
||||||
|
const submit = () => {
|
||||||
|
let params = baseFormRef.value.formData;
|
||||||
|
return {
|
||||||
|
params
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const open = () => {
|
||||||
|
init(nodeDetail.value);
|
||||||
|
baseMonacoEditorRef.value?.restLayout();
|
||||||
|
};
|
||||||
|
|
||||||
|
// onMounted(()=>{
|
||||||
|
// init(nodeDetail.value)
|
||||||
|
// })
|
||||||
|
|
||||||
|
// watch(nodeDetail,(v)=>{
|
||||||
|
// init(v)
|
||||||
|
// },{
|
||||||
|
// deep:true
|
||||||
|
// })
|
||||||
|
watch(
|
||||||
|
() => baseFormRef.value.formData,
|
||||||
|
val => {},
|
||||||
|
{
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
const init = v => {
|
||||||
|
const data = findNodesNext(props?.nodeDetail.id);
|
||||||
|
baseFormRef.value.setFormData(
|
||||||
|
JSON.parse(v?.taskParams || "{}")?.params || {}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleOK = value => {};
|
||||||
|
|
||||||
|
expose({
|
||||||
|
submit,
|
||||||
|
open
|
||||||
|
});
|
||||||
|
|
||||||
|
return () => (
|
||||||
|
<base-form
|
||||||
|
ref={baseFormRef}
|
||||||
|
v-slots={{
|
||||||
|
default: ({ model }) => (
|
||||||
|
<div class={"flex gap-[10px] w-full"}>
|
||||||
|
<div class={"w-[300px] overflow-auto flex flex-col"}>
|
||||||
|
<SqlStatement
|
||||||
|
baseFormRef={baseFormRef}
|
||||||
|
model={model}
|
||||||
|
></SqlStatement>
|
||||||
|
</div>
|
||||||
|
<div class={"flex flex-1 flex-col"}>
|
||||||
|
<base-form-item label="SQL语句:" prop="test" span={8}>
|
||||||
|
<div class={"w-full h-[200px]"}>
|
||||||
|
<BaseMonacoEditor
|
||||||
|
ref={baseMonacoEditorRef}
|
||||||
|
v-model={model.sqlString}
|
||||||
|
language="sql"
|
||||||
|
customReminders={{
|
||||||
|
test: ["liaoqiuyu"]
|
||||||
|
}}
|
||||||
|
></BaseMonacoEditor>
|
||||||
|
</div>
|
||||||
|
</base-form-item>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss"></style>
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
<script lang="tsx">
|
||||||
|
import {
|
||||||
|
computed,
|
||||||
|
defineComponent,
|
||||||
|
ref,
|
||||||
|
onMounted,
|
||||||
|
watchEffect,
|
||||||
|
watch
|
||||||
|
} from "vue";
|
||||||
|
import { useExposeDialogArgs } from "@qomo-platform/core";
|
||||||
|
import SqlStatementType from "@/components/SqlStatementType";
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: "dbOutput",
|
||||||
|
props: {
|
||||||
|
nodeDetail: {
|
||||||
|
type: Object
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setup(props, { attrs, expose, slots = {} }) {
|
||||||
|
const nodeDetail = computed(() => props?.nodeDetail);
|
||||||
|
const baseFormRef = ref({});
|
||||||
|
const baseMonacoEditorRef = ref();
|
||||||
|
const { findNodesPrev, findNodesNext, getNodeData } = attrs;
|
||||||
|
const submit = () => {
|
||||||
|
let params = baseFormRef.value.formData;
|
||||||
|
return {
|
||||||
|
params
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const open = () => {
|
||||||
|
init(nodeDetail.value);
|
||||||
|
baseMonacoEditorRef.value?.restLayout();
|
||||||
|
};
|
||||||
|
|
||||||
|
// onMounted(()=>{
|
||||||
|
// init(nodeDetail.value)
|
||||||
|
// })
|
||||||
|
|
||||||
|
// watch(nodeDetail,(v)=>{
|
||||||
|
// init(v)
|
||||||
|
// },{
|
||||||
|
// deep:true
|
||||||
|
// })
|
||||||
|
watch(
|
||||||
|
() => baseFormRef.value.formData,
|
||||||
|
val => {},
|
||||||
|
{
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
const init = v => {
|
||||||
|
const data = findNodesNext(props?.nodeDetail.id);
|
||||||
|
baseFormRef.value.setFormData(
|
||||||
|
JSON.parse(v?.taskParams || "{}")?.params || {}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleOK = value => {};
|
||||||
|
|
||||||
|
expose({
|
||||||
|
submit,
|
||||||
|
open
|
||||||
|
});
|
||||||
|
|
||||||
|
return () => (
|
||||||
|
<base-form
|
||||||
|
ref={baseFormRef}
|
||||||
|
v-slots={{
|
||||||
|
default: ({ model }) => (
|
||||||
|
<div class={"flex gap-[10px] w-full"}>
|
||||||
|
<div class={"w-[300px] overflow-auto flex flex-col"}>
|
||||||
|
<SqlStatementType
|
||||||
|
baseFormRef={baseFormRef}
|
||||||
|
model={model}
|
||||||
|
></SqlStatementType>
|
||||||
|
</div>
|
||||||
|
<div class={"flex flex-1 flex-col"}>
|
||||||
|
<base-form-item label="SQL语句:" prop="test" span={8}>
|
||||||
|
<div class={"w-full h-[200px]"}>
|
||||||
|
<BaseMonacoEditor
|
||||||
|
ref={baseMonacoEditorRef}
|
||||||
|
v-model={model.sqlString}
|
||||||
|
language="sql"
|
||||||
|
customReminders={{
|
||||||
|
test: ["liaoqiuyu"]
|
||||||
|
}}
|
||||||
|
></BaseMonacoEditor>
|
||||||
|
</div>
|
||||||
|
</base-form-item>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss"></style>
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
<script lang="tsx">
|
||||||
|
import {
|
||||||
|
computed,
|
||||||
|
defineComponent,
|
||||||
|
ref,
|
||||||
|
onMounted,
|
||||||
|
watchEffect,
|
||||||
|
watch
|
||||||
|
} from "vue";
|
||||||
|
import { useExposeDialogArgs } from "@qomo-platform/core";
|
||||||
|
import SqlStatement from "@/components/SqlStatement";
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: "dbOutput",
|
||||||
|
props: {
|
||||||
|
nodeDetail: {
|
||||||
|
type: Object
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setup(props, { attrs, expose, slots = {} }) {
|
||||||
|
const nodeDetail = computed(() => props?.nodeDetail);
|
||||||
|
const baseFormRef = ref({});
|
||||||
|
const baseMonacoEditorRef = ref();
|
||||||
|
const { findNodesPrev, findNodesNext, getNodeData } = attrs;
|
||||||
|
const submit = () => {
|
||||||
|
let params = baseFormRef.value.formData;
|
||||||
|
return {
|
||||||
|
params
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const open = () => {
|
||||||
|
init(nodeDetail.value);
|
||||||
|
baseMonacoEditorRef.value?.restLayout();
|
||||||
|
};
|
||||||
|
|
||||||
|
// onMounted(()=>{
|
||||||
|
// init(nodeDetail.value)
|
||||||
|
// })
|
||||||
|
|
||||||
|
// watch(nodeDetail,(v)=>{
|
||||||
|
// init(v)
|
||||||
|
// },{
|
||||||
|
// deep:true
|
||||||
|
// })
|
||||||
|
watch(
|
||||||
|
() => baseFormRef.value.formData,
|
||||||
|
val => {},
|
||||||
|
{
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
const init = v => {
|
||||||
|
const data = findNodesNext(props?.nodeDetail.id);
|
||||||
|
baseFormRef.value.setFormData(
|
||||||
|
JSON.parse(v?.taskParams || "{}")?.params || {}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleOK = value => {};
|
||||||
|
|
||||||
|
expose({
|
||||||
|
submit,
|
||||||
|
open
|
||||||
|
});
|
||||||
|
|
||||||
|
return () => (
|
||||||
|
<base-form
|
||||||
|
ref={baseFormRef}
|
||||||
|
v-slots={{
|
||||||
|
default: ({ model }) => (
|
||||||
|
<div class={"flex gap-[10px] w-full"}>
|
||||||
|
<div class={"w-[300px] overflow-auto flex flex-col"}>
|
||||||
|
<SqlStatement
|
||||||
|
baseFormRef={baseFormRef}
|
||||||
|
model={model}
|
||||||
|
></SqlStatement>
|
||||||
|
</div>
|
||||||
|
<div class={"flex flex-1 flex-col"}>
|
||||||
|
<base-form-item label="SQL语句:" prop="test" span={8}>
|
||||||
|
<div class={"w-full h-[200px]"}>
|
||||||
|
<BaseMonacoEditor
|
||||||
|
ref={baseMonacoEditorRef}
|
||||||
|
v-model={model.sqlString}
|
||||||
|
language="sql"
|
||||||
|
customReminders={{
|
||||||
|
test: ["liaoqiuyu"]
|
||||||
|
}}
|
||||||
|
></BaseMonacoEditor>
|
||||||
|
</div>
|
||||||
|
</base-form-item>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss"></style>
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
<script lang="tsx">
|
||||||
|
import {
|
||||||
|
computed,
|
||||||
|
defineComponent,
|
||||||
|
ref,
|
||||||
|
onMounted,
|
||||||
|
watchEffect,
|
||||||
|
watch
|
||||||
|
} from "vue";
|
||||||
|
import { useExposeDialogArgs } from "@qomo-platform/core";
|
||||||
|
import SqlStatement from "@/components/SqlStatement";
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: "dbOutput",
|
||||||
|
props: {
|
||||||
|
nodeDetail: {
|
||||||
|
type: Object
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setup(props, { attrs, expose, slots = {} }) {
|
||||||
|
const nodeDetail = computed(() => props?.nodeDetail);
|
||||||
|
const baseFormRef = ref({});
|
||||||
|
const baseMonacoEditorRef = ref();
|
||||||
|
const { findNodesPrev, findNodesNext, getNodeData } = attrs;
|
||||||
|
const submit = () => {
|
||||||
|
let params = baseFormRef.value.formData;
|
||||||
|
return {
|
||||||
|
params
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const open = () => {
|
||||||
|
init(nodeDetail.value);
|
||||||
|
baseMonacoEditorRef.value?.restLayout();
|
||||||
|
};
|
||||||
|
|
||||||
|
// onMounted(()=>{
|
||||||
|
// init(nodeDetail.value)
|
||||||
|
// })
|
||||||
|
|
||||||
|
// watch(nodeDetail,(v)=>{
|
||||||
|
// init(v)
|
||||||
|
// },{
|
||||||
|
// deep:true
|
||||||
|
// })
|
||||||
|
watch(
|
||||||
|
() => baseFormRef.value.formData,
|
||||||
|
val => {},
|
||||||
|
{
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
const init = v => {
|
||||||
|
const data = findNodesNext(props?.nodeDetail.id);
|
||||||
|
baseFormRef.value.setFormData(
|
||||||
|
JSON.parse(v?.taskParams || "{}")?.params || {}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleOK = value => {};
|
||||||
|
|
||||||
|
expose({
|
||||||
|
submit,
|
||||||
|
open
|
||||||
|
});
|
||||||
|
|
||||||
|
return () => (
|
||||||
|
<base-form
|
||||||
|
ref={baseFormRef}
|
||||||
|
v-slots={{
|
||||||
|
default: ({ model }) => (
|
||||||
|
<div class={"flex gap-[10px] w-full"}>
|
||||||
|
<div class={"w-[300px] overflow-auto flex flex-col"}>
|
||||||
|
<SqlStatement
|
||||||
|
baseFormRef={baseFormRef}
|
||||||
|
model={model}
|
||||||
|
></SqlStatement>
|
||||||
|
</div>
|
||||||
|
<div class={"flex flex-1 flex-col"}>
|
||||||
|
<base-form-item label="SQL语句:" prop="test" span={8}>
|
||||||
|
<div class={"w-full h-[200px]"}>
|
||||||
|
<BaseMonacoEditor
|
||||||
|
ref={baseMonacoEditorRef}
|
||||||
|
v-model={model.sqlString}
|
||||||
|
language="sql"
|
||||||
|
customReminders={{
|
||||||
|
test: ["liaoqiuyu"]
|
||||||
|
}}
|
||||||
|
></BaseMonacoEditor>
|
||||||
|
</div>
|
||||||
|
</base-form-item>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss"></style>
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
<script lang="tsx">
|
||||||
|
import {
|
||||||
|
computed,
|
||||||
|
defineComponent,
|
||||||
|
ref,
|
||||||
|
onMounted,
|
||||||
|
watchEffect,
|
||||||
|
watch
|
||||||
|
} from "vue";
|
||||||
|
import { useExposeDialogArgs } from "@qomo-platform/core";
|
||||||
|
import SqlStatement from "@/components/SqlStatement";
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: "dbOutput",
|
||||||
|
props: {
|
||||||
|
nodeDetail: {
|
||||||
|
type: Object
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setup(props, { attrs, expose, slots = {} }) {
|
||||||
|
const nodeDetail = computed(() => props?.nodeDetail);
|
||||||
|
const baseFormRef = ref({});
|
||||||
|
const baseMonacoEditorRef = ref();
|
||||||
|
const { findNodesPrev, findNodesNext, getNodeData } = attrs;
|
||||||
|
const submit = () => {
|
||||||
|
let params = baseFormRef.value.formData;
|
||||||
|
return {
|
||||||
|
params
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const open = () => {
|
||||||
|
init(nodeDetail.value);
|
||||||
|
baseMonacoEditorRef.value?.restLayout();
|
||||||
|
};
|
||||||
|
|
||||||
|
// onMounted(()=>{
|
||||||
|
// init(nodeDetail.value)
|
||||||
|
// })
|
||||||
|
|
||||||
|
// watch(nodeDetail,(v)=>{
|
||||||
|
// init(v)
|
||||||
|
// },{
|
||||||
|
// deep:true
|
||||||
|
// })
|
||||||
|
watch(
|
||||||
|
() => baseFormRef.value.formData,
|
||||||
|
val => {},
|
||||||
|
{
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
const init = v => {
|
||||||
|
const data = findNodesNext(props?.nodeDetail.id);
|
||||||
|
baseFormRef.value.setFormData(
|
||||||
|
JSON.parse(v?.taskParams || "{}")?.params || {}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleOK = value => {};
|
||||||
|
|
||||||
|
expose({
|
||||||
|
submit,
|
||||||
|
open
|
||||||
|
});
|
||||||
|
|
||||||
|
return () => (
|
||||||
|
<base-form
|
||||||
|
ref={baseFormRef}
|
||||||
|
v-slots={{
|
||||||
|
default: ({ model }) => (
|
||||||
|
<div class={"flex gap-[10px] w-full"}>
|
||||||
|
<div class={"w-[300px] overflow-auto flex flex-col"}>
|
||||||
|
<SqlStatement
|
||||||
|
baseFormRef={baseFormRef}
|
||||||
|
model={model}
|
||||||
|
></SqlStatement>
|
||||||
|
</div>
|
||||||
|
<div class={"flex flex-1 flex-col"}>
|
||||||
|
<base-form-item label="SQL语句:" prop="test" span={8}>
|
||||||
|
<div class={"w-full h-[200px]"}>
|
||||||
|
<BaseMonacoEditor
|
||||||
|
ref={baseMonacoEditorRef}
|
||||||
|
v-model={model.sqlString}
|
||||||
|
language="sql"
|
||||||
|
customReminders={{
|
||||||
|
test: ["liaoqiuyu"]
|
||||||
|
}}
|
||||||
|
></BaseMonacoEditor>
|
||||||
|
</div>
|
||||||
|
</base-form-item>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss"></style>
|
||||||
@@ -7,39 +7,94 @@ import {
|
|||||||
watchEffect,
|
watchEffect,
|
||||||
watch
|
watch
|
||||||
} from "vue";
|
} from "vue";
|
||||||
|
import { useExposeDialogArgs } from "@qomo-platform/core";
|
||||||
|
import SqlStatement from "@/components/SqlStatement";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "dbOutput",
|
name: "dbOutput",
|
||||||
props:{
|
props: {
|
||||||
nodeDetail:{
|
nodeDetail: {
|
||||||
type:Object
|
type: Object
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setup(props, { attrs, expose, slots = {} }) {
|
setup(props, { attrs, expose, slots = {} }) {
|
||||||
const formInline = reactive({});
|
const nodeDetail = computed(() => props?.nodeDetail);
|
||||||
|
const baseFormRef = ref({});
|
||||||
|
const baseMonacoEditorRef = ref();
|
||||||
|
const { findNodesPrev, findNodesNext, getNodeData } = attrs;
|
||||||
|
const submit = () => {
|
||||||
|
let params = baseFormRef.value.formData;
|
||||||
|
return {
|
||||||
|
params
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
const submit = ()=>{
|
const open = () => {
|
||||||
let param = formInline;
|
init(nodeDetail.value);
|
||||||
|
baseMonacoEditorRef.value?.restLayout();
|
||||||
|
};
|
||||||
|
|
||||||
return param
|
// onMounted(()=>{
|
||||||
}
|
// init(nodeDetail.value)
|
||||||
|
// })
|
||||||
|
|
||||||
|
// watch(nodeDetail,(v)=>{
|
||||||
|
// init(v)
|
||||||
|
// },{
|
||||||
|
// deep:true
|
||||||
|
// })
|
||||||
|
watch(
|
||||||
|
() => baseFormRef.value.formData,
|
||||||
|
val => {},
|
||||||
|
{
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
const init = v => {
|
||||||
|
const data = findNodesNext(props?.nodeDetail.id);
|
||||||
|
baseFormRef.value.setFormData(
|
||||||
|
JSON.parse(v?.taskParams || "{}")?.params || {}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleOK = value => {};
|
||||||
|
|
||||||
expose({
|
expose({
|
||||||
submit
|
submit,
|
||||||
})
|
open
|
||||||
|
});
|
||||||
|
|
||||||
return () => (
|
return () => (
|
||||||
<el-form label-width="auto" v-model={formInline}>
|
<base-form
|
||||||
<el-form-item label="Name">
|
ref={baseFormRef}
|
||||||
<el-input v-model={formInline.name} />
|
v-slots={{
|
||||||
</el-form-item>
|
default: ({ model }) => (
|
||||||
<el-form-item label="Activity zone">
|
<div class={"flex gap-[10px] w-full"}>
|
||||||
<el-input v-model={formInline.region} />
|
<div class={"w-[300px] overflow-auto flex flex-col"}>
|
||||||
</el-form-item>
|
<SqlStatement
|
||||||
<el-form-item label="Activity form">
|
baseFormRef={baseFormRef}
|
||||||
<el-input v-model={formInline.type} />
|
model={model}
|
||||||
</el-form-item>
|
></SqlStatement>
|
||||||
</el-form>
|
</div>
|
||||||
|
<div class={"flex flex-1 flex-col"}>
|
||||||
|
<base-form-item label="SQL语句:" prop="test" span={8}>
|
||||||
|
<div class={"w-full h-[200px]"}>
|
||||||
|
<BaseMonacoEditor
|
||||||
|
ref={baseMonacoEditorRef}
|
||||||
|
v-model={model.code}
|
||||||
|
language="sql"
|
||||||
|
customReminders={{
|
||||||
|
test: ["liaoqiuyu"]
|
||||||
|
}}
|
||||||
|
></BaseMonacoEditor>
|
||||||
|
</div>
|
||||||
|
</base-form-item>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -20,6 +20,46 @@ export const qomoPlatformOptions = {
|
|||||||
label: "首批",
|
label: "首批",
|
||||||
value: "C"
|
value: "C"
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
modelStatus: [
|
||||||
|
{
|
||||||
|
label: "草稿",
|
||||||
|
value: "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "已发布",
|
||||||
|
value: "2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "运行中",
|
||||||
|
value: "3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "已完成",
|
||||||
|
value: "4"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
feeTypeList:[
|
||||||
|
{
|
||||||
|
label: "机器折旧费",
|
||||||
|
value: "EquipmentFee"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "辅料费",
|
||||||
|
value: "SupplyMaterialFee"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "水电费",
|
||||||
|
value: "DriverFee"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "其他费用",
|
||||||
|
value: "OtherFee"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "物流费",
|
||||||
|
value: "LogisticsFee"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
async provider(dictType) {
|
async provider(dictType) {
|
||||||
|
|||||||
+25
-12
@@ -69,18 +69,18 @@ export const constantRoutes = [
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// path: '',
|
path: '',
|
||||||
// component: Layout,
|
component: Layout,
|
||||||
// children: [
|
children: [
|
||||||
// {
|
{
|
||||||
// path: "/hour",
|
path: "/hour",
|
||||||
// component: () => import("@/views/hour/index"),
|
component: () => import("@/views/hour/index"),
|
||||||
// name: "Hour",
|
name: "Hour",
|
||||||
// meta: { title: "小时费率", icon: "money", affix: true }
|
meta: { title: "小时费率", icon: "money", affix: true }
|
||||||
// }
|
}
|
||||||
// ]
|
]
|
||||||
// },
|
},
|
||||||
// {
|
// {
|
||||||
// path: '',
|
// path: '',
|
||||||
// component: Layout,
|
// component: Layout,
|
||||||
@@ -153,6 +153,19 @@ export const constantRoutes = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: Layout,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: "modelManagement/index",
|
||||||
|
component: () => import("@/views/modelManagement/index"),
|
||||||
|
name: "Modelmanagement",
|
||||||
|
meta: { title: "成本计算模型管理", icon: "tree", affix: true }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
// Bom,工序,采购价格
|
||||||
];
|
];
|
||||||
|
|
||||||
//本地调试默认路由
|
//本地调试默认路由
|
||||||
|
|||||||
+3
-3
@@ -3,13 +3,13 @@ import Cookies from "js-cookie";
|
|||||||
const TokenKey = "Admin-Token";
|
const TokenKey = "Admin-Token";
|
||||||
|
|
||||||
export function getToken() {
|
export function getToken() {
|
||||||
return Cookies.get(TokenKey);
|
return window.localStorage.getItem(TokenKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setToken(token) {
|
export function setToken(token) {
|
||||||
return Cookies.set(TokenKey, token);
|
return window.localStorage.setItem(TokenKey, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function removeToken() {
|
export function removeToken() {
|
||||||
return Cookies.remove(TokenKey);
|
return window.localStorage.removeItem(TokenKey);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,140 @@
|
|||||||
|
<script lang="tsx">
|
||||||
|
//表格
|
||||||
|
import { defineComponent, ref } from "vue";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
import { transformPageResponse } from "@/utils/qomo";
|
||||||
|
import { modelList,deleteModel } from "@/api/modelManagement";
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
import { ro } from "element-plus/es/locale";
|
||||||
|
export default defineComponent({
|
||||||
|
setup() {
|
||||||
|
const router = useRouter();
|
||||||
|
const tableRef = ref();
|
||||||
|
const forecastDialogRef = ref();
|
||||||
|
const selectionRows = ref([]);
|
||||||
|
// const uploadUrl = ref("/c7525cost/importExcel");
|
||||||
|
//列
|
||||||
|
const columns = ref([
|
||||||
|
{ prop: "drawingNo", label: "图号" },
|
||||||
|
{ label: "物料号", prop: "materialNo" },
|
||||||
|
{ label: "物料类型", prop: "materialType" },
|
||||||
|
{ prop: "modelName", label: "模型名称", hideInSearchForm: true },
|
||||||
|
{ prop: "modelVersion", label: "模型版本", hideInSearchForm: true },
|
||||||
|
{
|
||||||
|
valueType: "date",
|
||||||
|
prop: "createTime",
|
||||||
|
label: "创建时间",
|
||||||
|
hideInSearchForm: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "status",
|
||||||
|
label: "状态",
|
||||||
|
valueType: "dict-select",
|
||||||
|
extraProps: { dictType: "modelStatus" }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "operation",
|
||||||
|
label: "操作",
|
||||||
|
minWidth: 120,
|
||||||
|
render: ({ row, doAddOrEdit, doDeleteRows, doPreview }) => (
|
||||||
|
<base-table-operation
|
||||||
|
btnList={[
|
||||||
|
{
|
||||||
|
key: "edit",
|
||||||
|
label: "编辑",
|
||||||
|
onclick: () => doAddOrEdit(row)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "delete",
|
||||||
|
label: "删除",
|
||||||
|
onclick: () => doDeleteRows(row)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "release",
|
||||||
|
label: "发布",
|
||||||
|
onclick: () => releaseRows(row)
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
const render = () => {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<BaseTable
|
||||||
|
columns={columns.value}
|
||||||
|
ref={tableRef}
|
||||||
|
selectionRows={selectionRows.value}
|
||||||
|
toolbar={{
|
||||||
|
layout: "search-dnamic,reload,column-setting,fullscreen"
|
||||||
|
}}
|
||||||
|
request={async ({
|
||||||
|
pageSize = 10,
|
||||||
|
current = 1,
|
||||||
|
...otherSearchParams
|
||||||
|
}) => {
|
||||||
|
let tableData = {};
|
||||||
|
tableData = transformPageResponse(
|
||||||
|
await modelList({
|
||||||
|
pageNo: current,
|
||||||
|
pageSize,
|
||||||
|
...otherSearchParams
|
||||||
|
})
|
||||||
|
);
|
||||||
|
tableData.data.forEach(item => {
|
||||||
|
if (item.status == "1") {
|
||||||
|
item.status = "草稿";
|
||||||
|
} else if (item.status == "2") {
|
||||||
|
item.status = "已发布";
|
||||||
|
} else if (item.status == "3") {
|
||||||
|
item.status = "运行中";
|
||||||
|
} else if (item.status == "4") {
|
||||||
|
item.status = "已完成";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return tableData;
|
||||||
|
}}
|
||||||
|
curdConfig={{
|
||||||
|
/**
|
||||||
|
* 接受自动表单的数据
|
||||||
|
* @param data
|
||||||
|
*/
|
||||||
|
async onAddOrEdit(data) {
|
||||||
|
if (data.id) {
|
||||||
|
await editHourRate(data);
|
||||||
|
} else {
|
||||||
|
await addHourRate(data);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/*删除*/
|
||||||
|
async onDeleteRows(data) {
|
||||||
|
await deleteModel({ id: data.id });
|
||||||
|
},
|
||||||
|
unitColSpan: 12
|
||||||
|
}}
|
||||||
|
v-slots={{
|
||||||
|
toolbar: () => (
|
||||||
|
<el-space>
|
||||||
|
<el-button type="primary" onClick={addModel}>
|
||||||
|
新增模型
|
||||||
|
</el-button>
|
||||||
|
</el-space>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
const releaseRows = () => {
|
||||||
|
console.log("发布");
|
||||||
|
};
|
||||||
|
const addModel = () => {
|
||||||
|
router.push({ path: "/test/index" });
|
||||||
|
}
|
||||||
|
return render;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
+42
-1240
File diff suppressed because it is too large
Load Diff
+18
-4
@@ -22,7 +22,7 @@ function getLocalIpAddress() {
|
|||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig(({ mode, command }) => {
|
export default defineConfig(({ mode, command }) => {
|
||||||
const env = loadEnv(mode, process.cwd());
|
const env = loadEnv(mode, process.cwd());
|
||||||
const { VITE_APP_ENV ,VITE_APP_PATH} = env;
|
const { VITE_APP_ENV, VITE_APP_PATH } = env;
|
||||||
return {
|
return {
|
||||||
// 部署生产环境和开发环境下的URL。
|
// 部署生产环境和开发环境下的URL。
|
||||||
// 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上
|
// 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上
|
||||||
@@ -50,18 +50,32 @@ export default defineConfig(({ mode, command }) => {
|
|||||||
disableHostCheck: true,
|
disableHostCheck: true,
|
||||||
host: getLocalIpAddress(),
|
host: getLocalIpAddress(),
|
||||||
open: true,
|
open: true,
|
||||||
hmr:{overlay:false},
|
hmr: { overlay: false },
|
||||||
proxy: {
|
proxy: {
|
||||||
// https://cn.vitejs.dev/config/#server-proxy
|
// https://cn.vitejs.dev/config/#server-proxy
|
||||||
"/qomo": {
|
"/qomo": {
|
||||||
// target: "http://172.16.0.241:8095", //wq
|
// target: "http://172.16.0.241:8095", //wq
|
||||||
target: "http://172.16.0.214:8095", //bgy
|
target: "http://172.16.0.162:8082", //bgy
|
||||||
// target: "http://192.168.50.9:8095",
|
// target: "http://192.168.50.9:2999",//中智平台
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
"^/qomo": "/qomo"
|
"^/qomo": "/qomo"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/qomo/flowSocket": {
|
||||||
|
// target: 'ws://192.168.0.66:60601/',这是后端接口地址
|
||||||
|
target: 'ws://172.16.0.162:8082',
|
||||||
|
// target: 'ws://192.168.50.99:2999',
|
||||||
|
changeOrigin: true,
|
||||||
|
ws: true
|
||||||
|
},
|
||||||
|
"/qomo/taskSocket": {
|
||||||
|
// target: 'ws://192.168.0.66:60601/',这是后端接口地址
|
||||||
|
target: 'ws://172.16.0.162:8082',
|
||||||
|
// target: 'ws://192.168.50.99:2999',
|
||||||
|
changeOrigin: true,
|
||||||
|
ws: true
|
||||||
|
},
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
"Access-Control-Allow-Origin": "*"
|
"Access-Control-Allow-Origin": "*"
|
||||||
|
|||||||
Reference in New Issue
Block a user